CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Posts
    180

    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.

  2. #2
    Join Date
    Jun 2009
    Posts
    10

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured