First set up a file storage style settings (resource dictionary), all style settings can be done here
Add the following code:
<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"> <!--form style settings-<style x:key="Userwindow"Targettype="{x:type Window}"> <setter property="FontFamily"Value="Microsoft Ya-Black"/> <setter property="FontSize"Value=" -"/> <setter property="BorderBrush"Value="Blue"/> <setter property="FontWeight"Value="Black"/> </Style></ResourceDictionary>Resource Dictionary Code
Make the following settings in App.xaml
<application x:class="Oilsystem.app"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"XMLNS:MC="http://schemas.openxmlformats.org/markup-compatibility/2006"StartupUri="View\main\mainwindow.xaml"mc:ignorable="D"> <Application.Resources> <!--Global View Model locator--> <!--<vm:viewmodellocator x:key="Locator"D:isdatasource="True"/>--> <!--The following line of code is the resource dictionary that needs to be used--<resourcedictionary source="Skins/windowexpanderstyle.xaml"/> </Application.Resources></Application>
App.xaml File Settings
Called when the following method
<window x:class="OilSystem.View.Main.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"Title="MainWindow"height="301"Width="509"style="{StaticResource Userwindow}">See style= this setting
Run a look at the effect, the skin is set to do so, change the contents of the resource dictionary can be changed directly style
Setting UI information with static resources