We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to make events fire with unloading of the TabControlExt in selection change?

Events of the elements in the TabItemExt’s content does not fire after TabItem selection change when hooked in constructor. This is due to content unloading behaviour of the TabControlExt. Content of TabItemExt is unloaded on selection change and loaded again when this tab item is selected. This problem can be resolved by hooking all the events in the Loaded event instead of the constructor.

For example, there are two TabItems and their contents are UserControl1 and UserControl2, respectively.

In the UserControl1, events of its elements are hooked in its constructor.

In the UserControl2, events of its elements are hooked in its Loaded event.

MainWindow.xaml


UserControl1.xaml and UserControl2.xaml

UserControl1.xaml.cs


UserControl2.xaml.cs


The following screenshots show the TextChanged event failed to fire after Tab selection change in TabItem 1:

Figure 1: TextChanged event firing before tab item selection change

 

Figure 2: TextChanged event not firing after tab item selection change

Article ID: Published Date: Last Revised Date: Platform: Control:
4899 05/18/2015 05/18/2015 WPF TabControlExt
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon