Windows Phone adding eventhandler from different classes
Using this code, i am adding an eventhandler to the RootFrame.Obscured.
(Application.Current as App).RootFrame.Obscured += onObScured;
Since the RootFrame can be accessed from every class in the App, what
happens if i add different eventhandlers from different classes? Example:
class A{
(Application.Current as App).RootFrame.Obscured += onObScuredA;
private void onObScuredA(object sender, ObscuredEventArgs e) {
//Some code here
}
}
class B{
(Application.Current as App).RootFrame.Obscured += onObScuredB;
private void onObScuredB(object sender, ObscuredEventArgs e) {
//Some other code here
}
}
When the event is triggered, will both onObScuredA() and onObScuredB() be
triggered if there has been created an instance of both A and B? Is the
correct way, to add the eventhandlers, and their respective methods on the
App.xaml.cs class so i can be certain which eventhandlers are added?
Thanks.
No comments:
Post a Comment