开发者

Override page events

开发者 https://www.devze.com 2023-01-28 14:16 出处:网络
I\'m tryi开发者_开发知识库ng to override some page events for wp7, but have no luck. I tryed to override OnFocus, OnNavigatedTo like this:

I'm tryi开发者_开发知识库ng to override some page events for wp7, but have no luck. I tryed to override OnFocus, OnNavigatedTo like this:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
   base.OnNavigatedTo(e);
   Debug.WriteLine("NavigatedTo");
}


The code you've posted works fine. What issue are you having?

There is no OnFocus() event. There are OnGotFocus() and OnLostFocus() events exposed due to the pages inheritence from Control. Note that the page can only receive focus when you explicitly set it in code. But, these events will also be triggered through event bubbling from child controls on the page.


I had a CTP version of WP7 SDK, that was a problem

0

精彩评论

暂无评论...
验证码 换一张
取 消