Hi, I have a simple question which is giving me some difficulty. I have downloaded a custom them for WPF of the net. Now i want to apply this theme to my App instead of the default one.
How do i do that, Do i do it in XAML or in Code ?
Thanks Iffy
Hi, I have a simple question which is giving me some difficulty. I have downloaded a custom them for WPF of the net. Now i want to apply this theme to my App instead of the default one.
How do i do that, Do i do it in XAML or in Code ?
Thanks Iffy
Add namesapce of your theme:
xmlns:expDark="clr-namespace:System.Windows.Controls.Theming; assembly=System.Windows.Controls.Theming.ExpressionDark"
xmlns:theming="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.Toolkit"
And wrap your controls with theme in XAML.
<!-- expDark:ExpressionDarkTheme is theme what I want to apply-->
<expDark:ExpressionDarkTheme>
<Button Content="Счастье" Width="200" Height="50"
FontSize="26" Margin="10"></Button>
</expDark:ExpressionDarkTheme>
I just came across something that answered my problem in one. I used the line
<ResourceDictionary Source="Themes/ExpressionDark.xaml"/>
This i put into my Windows resources inside a merged dictionary. What this did was apply my theme to the window as a default theme. Easy and quick.
Hope this helps others in future.
Thanks Iffy.