There are two XamComboEditor controls in the library. One in the Infragistics.Controls.Editors and another in Infragistics.Windows.Editors.
I am having to use the Infragistics.Controls.Editors.XamComboEditor because it allows autocomplete/filtering on conditional operator (example below)
<ig:XamComboEditor AllowFiltering="True" AutoComplete="True" ItemsSource="{Binding BookCodes}" SelectedItem="{Binding SelectedBook}"> <ig:XamComboEditor.ItemFilters> <ig:ComboItemFilter> <ig:ComboItemFilter.Conditions> <ig:ComparisonCondition Operator="Contains" /> </ig:ComboItemFilter.Conditions> </ig:ComboItemFilter> </ig:XamComboEditor.ItemFilters></ig:XamComboEditor>
However, to define a style for this control, based on one of your themes against it is not striaghtforward. There is a style defined for Infragistics.Windows.Editors.XamComboEditor but not for Infragistics.Controls.Editors.XamComboEditor.
<ResourceDictionary xmlns="">schemas.microsoft.com/.../presentation" xmlns:x="">schemas.microsoft.com/.../xaml" xmlns:editors="">infragistics.com/Editors" xmlns:igThemes="">infragistics.com/Themes"> <Style BasedOn="{x:Static igThemes:EditorsRoyalLight.XamComboEditor}" TargetType="{x:Type editors:XamComboEditor}"> <Setter Property="Margin" Value="3" /> </Style></ResourceDictionary>
Hi Somanna,
Thank you for posting to Infragistics Community!
I have been looking into your question and you are correct that styling the Infragistics.Controls.Editors.XamComboEditor based on any of the predefined themes would not be as straightforward as the Infragistics.Windows.Editors one, however, it is still possible. Hence, I am wondering if your question is about the approach to achieve this?
Assuming this is the case, and that the target theme would be RoyalLight, I will describe the approach to add a custom style to the Infragistics.Controls.Editors.XamComboEditor based on this theme.
It involves copying the RoyalLight.xamComboEditor.xaml and its dependent files (RoyalLight.Styles.xaml and RoyalLight.Theme.Colors.xaml) from the Infragistics DefaultStyles directory to your app. They can be found under:
C:\Program Files (x86)\Infragistics\*your version*\WPF\Themes\ RoyalLight
Once the relevant files are included, they can be merged in a ResourceDictionary and the custom style can be based on the corresponding RoyalLight one:
<Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source=" RoyalLight.xamComboEditor.xaml" /> </ResourceDictionary.MergedDictionaries> <Style TargetType="{x:Type ig:XamComboEditor}" BasedOn="{StaticResource XamComboEditorStyle}"> <Style.Setters> <Setter Property="Background" Value="#FFFBC6C6" /> </Style.Setters> </Style> <local:DataUtil x:Key="DataUtil" /> </ResourceDictionary> </Window.Resources>
Attached you will find a sample demonstrating this. Please, test it on your side and if you require any further assistance on the matter, please let me know.
Best regards,Bozhidara PachilovaAssociate Software Developer
7802.XCE_Input_RoyalLight_Theme.zip
Hi Bozhidara,
Thanks for getting back. Is this the only option? Ideally we don't want to keep a copy of the style which means whenever we upgrade to a newer version, the exercise of copying these will have to repeated.
Thanks,
Somanna