开发者

Tab control in Silverlight 3.0 and Dirty data

We are using tab control in our project. While using this control i came across a few issues like - When the tab control loads, it invokes constructor of all the xaml pages that form the individual tabs. Can this be avoided?

  • Is there any event with tab control that we can use to identify dirty data on the previous tab that i may have visited. I mean can i prevent user from navigating to some other tab before saving the changes on current 开发者_运维技巧tab.


You should be able to avoid the instantiation of each xaml page in the individual tabs by adding the content to the tabs dynamically, right before they are shown for the first time. You might be able to get away with doing this on the tab control's SelectionChanged event.

The tab control does not have a dirty state management. At best, you individual containers/pages will have to handle the dirty state.


I mean can i prevent user from navigating to some other tab before saving the changes on current tab.

I don't think you can prevent it. We have something similar in our app and the route we have chosen is if the page is validated then the Tabs becomes enabled so they can either click save or navigate to a different tab. In case they navigate to a different tab without clicking on save we will perform save for them. I think as a user perspective this is a good thing!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜