Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Too many loaded events on page
1 replies. Latest Post by slouge on October 2, 2009.
(0)
mtiede@s...
Member
148 points
275 Posts
08-01-2009 5:30 PM |
I navigate to a page. The Loaded event handler is called. I have a button that, when clicked, navigates to another page. After clicking the button, I see the other pages constructor called, then a user control on that page constructor is called, then the Loaded event handler of the original page is called AGAIN. Wha'ts up with that? Why would it be called again and how can I tell the difference between the two.
Here is all I do in the button click:
NavigationService.Navigate( new Uri( 'MyPage?Edit=1', UriKind.Relative ) );
The only thing I can think is that the TransitionContentControl that is supposed to fade from one to the other is reloading the one it is fading from...
slouge
6 points
6 Posts
10-02-2009 4:05 PM |
public YourView() { InitializeComponent(); Loaded += new RoutedEventHandler(OnLoaded); } void OnLoaded(object sender, RoutedEventArgs e) { Loaded -= new RoutedEventHandler(OnLoaded); //your stuff }