下面是代码,我想在其中更改 MahApps.Metro 包的主题颜色。
它可以通过更改 MahApps 的 ResourceDictionary Source 包来更改。[/MahApps.Metro;component/Styles/Accents/Blue.xaml]
现在说它的 /Blue.xaml 示例......我们可以更改窗口的颜色。到 /Red.xaml , /Yellow.xaml 等
那么如何每 5 秒异步更改一次窗口的颜色呢?这在 wpf 中可能吗?
我是 wpf 的新手,一无所知。
<controls:MetroWindow x:Class="NginX.Choose"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="NginX" Height="350" Width="350" ShowMaxRestoreButton="False">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
</Grid>
</controls:MetroWindow>