That is an interesting thought, and I did not know that Viagra has been implicated in the development of melanoma.
I am unsure if this will change the view that melanoma is caused by the sun. A lot of research suggests that infrequent, excessive sun exposure can increase the risk of melanoma.
On the other hand, moderate and consistent sun exposure (i.e. 15-20 minutes each day) has been suggested to reduce the risk of melanoma.
The relationship between sun exposure and skin cancer is complex. While other factors may relate to melanoma, I feel that research will continue to look into the complex relationship between sun exposure and skin cancer until we can know with certainty.