I have 2 tabs, when a button is clicked, tab2 is set to be collapsed. but the content of tab2 is still shown after the click.
Is a easier why to let the selected tab to be tab1 if tab2's visibility is set to collapsed.
Thanks,
Joan
Hi Joan,
Cool. Glad it's working now. Let me know if you have any further questions on this matter.
This one URL worked.
<ResourceDictionary Source="pack://Application:,,,/Resources/PrimitivesIGTheme.xaml" />
Technically you can put it where ever you want. It's a ResourceDictionary so using it is the same as any other ResourceDictionary. In my sample I just placed it directly in the project but if you want to keep it inside a folder called 'Resources' then you'll need to change the URI that is used in XAML to load it. If you look at my sample, in MainWindow.xaml you can see the following code:
<ResourceDictionary Source="PrimitivesIGTheme.xaml"/>
If you place PrimitivesIGTheme.xaml inside a folder you need to alter the URI above to reflect that change.
<ResourceDictionary Source="Resources/PrimitivesIGTheme.xaml"/>
Add PrimitiveIGTheme.xaml works for me. but do i have to put that in the same folder as my usercontrol.xaml. I tried to put it under Resources folder, it's not recognized.
Thank you!
I assume when you say that tabs 6 to 12 lose their header color and selected color that you have a style applied to them as well? Or do you have a theme applied to the XamTabControl? If you have a theme set, then that would explain why you lose the coloring.
To answer your question, yes, adding a BasedOn to the style will solve this but like you said, how would you create a style based on the default style? To do this you're going to need to add the default style used by your theme to your project first. Once this style is placed into the window/control resources, you can modify your style to include the BasedOn property like so:
<!-- Style from theme must be added first. --> <!-- Now your style can be added. --> <Style x:Key="tab6to12Style" TargetType="{x:Type igWindows:TabItemEx}" BasedOn="{StaticResource {x:Type igWindows:TabItemEx}}">
I've attached a sample that demonstrates this. My sample uses the IG Theme but this solution will work with any theme. Just make sure you replace my PrimitivesIGTheme.xaml with the proper theme file that matches the one you're using. The theme files can be found at C:\Program Files (x86)\Infragistics\NetAdvantage 2012.2\WPF\DefaultStyles\Windows.