Current filter:
                                You should refresh the page.
                                  • Hi,

                                    We needs to override DX theme very often in our work, like:

                                    <Style x:Key="rowStyle"

                                    BasedOn="{StaticResource {dxgt:GridRowThemeKey ThemeName=OnyxDark, ResourceKey=RowStyle}}"
                                    TargetType="dxg:GridRowContent"/>

                                    But I found that it is not very convenient to support multiple Themes: Need to create different copies of resouces based on different ThemeName parameter.

                                    Want to know is there any way to set ThemeName as current ApplicationTheme dynamically ? Sth like:

                                    <Style x:Key="rowStyle"
                                    BasedOn="{StaticResource {dxgt:GridRowThemeKey ThemeName={xxxApplicationTheme}, ResourceKey=RowStyle}}"
                                    TargetType="dxg:GridRowContent"/>

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Junjie,
                                It is impossible to modify a Style (including the BasedOn property) when it is already applied to a visual element. This is a WPF limitation. That's why it is necessary to define resources for all required themes.
                                Thanks,
                                Alexander

                                • xaverine ts 09.01.2014

                                  Hi,
                                  below is how I did it:
                                  <Border BorderBrush="{DynamicResource {dxt:BrushesThemeKey ResourceKey=SelectedItem, ThemeName={x:Static dx:ThemeManager.ActualApplicationThemeName}}}">
                                  ...
                                  </Border>
                                  when the element is loaded/reloaded, the ThemeName property gets value from ThemeManager.
                                  However, users may change themes during the element's normal life span.
                                  How do I change above xaml expression to binding like, with real time theme name changes?

                                • Ivan (DevExpress Support) 09.02.2014

                                  In fact, my colleague has created a special extension that allows applying resources according to the current theme. I have attached a sample demonstrating how to use it. I am looking forward to your feedback once you have had the opportunity to review the sample.