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.
UserControl1.xaml and UserControl2.xaml
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:|