<sync:ChromelessWindow
x:Class="ViewCoreModul.Views.ChromelessChildWindow"
Title="{Binding Title}"
Width="{Binding ChromeWidth, Mode=TwoWay}"
Height="{Binding Chromeheight, Mode=TwoWay}"
ResizeMode="{Binding Mode}">
<Grid />
</sync:ChromelessWindow>
|
<sync:ChromelessWindow
x:Class="ViewCoreModul.Views.ChromelessChildWindow"
Title="{Binding Title}"
Width="{Binding ChromeWidth, Mode=TwoWay}"
Height="{Binding Chromeheight, Mode=TwoWay}"
|
Hi,
How can the ChromelessWindow inherit the VisualStyle from the main window?
In Project1 from the sample ( https://www.syncfusion.com/downloads/support/directtrac/general/ze/PrismDialogProjects_Modified867248622.zip ), the OpenChromelessWindowCommand opens a dialog window, but the visual style is some default value - it does not inherit the style set at the MainWindowViewModel:
SfSkinManager.ApplyStylesOnApplication = true;
SfSkinManager.SetVisualStyle(Application.Current.MainWindow, (VisualStyles)Enum.Parse(typeof(VisualStyles), "MaterialDark"));
I've tested with the latest version of Syncfusion.SfSkinManager.WPF" (25.1.41).
Please let me know how I can have the same visual style as the main window.
Regards,
Artur
Hi Service Team,
I'm experiencing similar issues with prisms implementation of Dialogs.
When I start the application the default is set to the Theme Windows11Light, the aforementioned dialog is represented correctly:
when I switch the Theme to Windows11Dark the Mainwindow does change all Elements Accordingly, but the Dialog does change the font settings but not the background and controls accordingly:
I did assume that it has something to do with Prisms Dialoghost (which is the visual parent of the dialog). So I did precautions in order to set the Theme for the Dialoghost accordingly but this does also not fix the issue:
As this did also not resolve the issue, I tried also to apply the theme in each dialog window, but this did also not fix the issue.
Unfortunately I cannot upload the solution since there is confidential Information within the solution.
Maybe your support can give an update on the Topic ?
Best regards
Sven
Hi,
To apply a theme globally in an application, set the ApplyStylesOnApplication property to True. This merges all the theme resource files into Application.Current.Resources. However, the attached properties Theme set in SfSkinManager will inherit to all controls in the visual tree but will not be notified for dynamically created windows (e.g., pop-up windows).
Since these are detachable visual elements, their style will only be changed by modifying the style property value directly. Other controls will have an overridden style if the style is merged into the resources without any key. Therefore, the style applied to the MainWindow will not apply to dynamically created windows. You need to set the theme for any new window created dynamically.
We have modified the sample to resolve the issue. Please find the attached sample for further reference.
Regards,
Bhaskar Suresh