1

I have created TabItems in silverlight where each tab display some text. When i change the text then it show asterisk at the Header of TabItem with header name.

Now what i want to achieve is : suppose i made a change on the current TabItem text display then when i switch from the one tab to another tab item then it must show a pop up saying "do you wanna save the changes done ?"

Does silverlight provide any facility in TabItem to notify when there is change in the TabItem (I mean when switching is done from one tabitem to another) ?

On switching here from one tab item to another must pop up a message that do you wanna save the change in the previous tab. How to get notification of switching the TabItem(NOT TabControl) ?

user3735822
  • 337
  • 2
  • 12
  • 2
    Not sure if I should mark this as duplicate of [this one](http://stackoverflow.com/questions/7359765/silverlight-tabchanged-event-tabcontrol) or not. – Chris W. Jul 21 '14 at 15:45
  • Yep, pretty much a duplicate. Use the SelectionChanged event and then set the SelectedItem/Index (or not) based on whether you want to allow the selected tab to change. – Mashton Jul 22 '14 at 10:59
  • @Mashton SelectionChanhged event do not work for TabItem in Silverlight. any otherway you know ? and its not same as that link – user3735822 Jul 22 '14 at 11:30
  • SelectionChanged is for the TabControl (parent), which is where you should be making the decision of whether to change tabs or not. – Mashton Jul 22 '14 at 12:30
  • I am changing TabItems (not TabControls). I mean switching of TabItems must popup some messagebox – user3735822 Jul 22 '14 at 12:37
  • When you are switching between TabItems the TabControl will raise a SelectionChanged event. – Martin Jul 22 '14 at 13:33

0 Answers0