Is there something like an "OnPaint" method in C# and Silverlight?
Is there something like an "OnPaint" method in C# and Silverlight?
Back when I was writing C++, I found that it was easy to use the OnPaint event to customize the display of a class to the screen?
Is there an equivalent in C# with Silverlight? If I want to do something when a UserControl is displayed on the screen, what method would I override?
I noticed that, in WPF, there is an OnRender method, but it seems that in C#/Silverlight, there is no "OnRender" method for a UserControl class.
Re: Is there something like an "OnPaint" method in C# and Silverlight?
Every UserControl/Page has a Loaded event you could use for things like that. If you're using caching, you might consider the OnNavigatedTo event of the Page.