Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1080
Custome themes
posted

Hello Alex,
I have a problem with themes.
I created two custom themepacks following the given examples in the infragistics help.
In the two datapresenter xaml there are few differences for some grid style (CellValuePresenter, GroupByRecordPresenter and GroupByAreaMulti)
Application user can toggle between the two themes clicking a button (like in the xamfeaturebrowser example 'Setting the theme'): through code I change the grid Theme property.

Now everything works OK except for the GroupByAreaMulti style: toggling between themes seems to have no effect (note that  the difference between the two themes refers actually only to the background color). Note also that the groupByAreaMulti is external.
Can you please help?

Thanks VALERIO

Parents
No Data
Reply
  • 69686
    Suggested Answer
    posted

    Hello Valerio,

    If you are using an external GroupByArea, this is the expected behavior. This happens, because the GroupByAreaMulti is using the styles from the resource dictionaries that you have defines (by default in the window's resources - the ones of your custom theme). It will not pick up the styles that the current theme sets to the XamDataGrid, because these styles are inside the resources of the XamDataGrid itself.

    This is how the WPF styles system works. You can try putting the merged dictionaries in different element's resources, so that the GroupByArea does not pick them (i.e. the GroupByArea is higher in the element tree than the resources, for example :

    <StackPanel>

            <igDP:GroupByAreaMulti Margin="0,10,0,10" />

            <StackPanel>

                <StackPanel.Resources>

                    <ResourceDictionary>

                        <ResourceDictionary.MergedDictionaries>

                            <igThemeOrangePeel:DataPresenter/>

                        </ResourceDictionary.MergedDictionaries>

                    </ResourceDictionary>

                </StackPanel.Resources>

                 <igDP:XamDataGrid GroupByAreaLocation="None" BindToSampleData="True" 

                              Name="xamDataGrid1" />

            </StackPanel>

        </StackPanel>

     

Children
No Data