FrameworkElement.Resources(页面资源字典)
开发工具与关键技术:VS、WPF、XAML
作者:郑凯丰
撰写时间:2019年5月16日
代码:
<Window x:Class="Testitem.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="500">
1.设定代码:
<Grid>
<!--定义Grid的资源字典-->
<Grid.Resources>
<!--资源字典:可以定义多个资源-->
<ResourceDictionary>
2.第一个线性渐变画刷
<!--1.线性渐变画刷-->
<LinearGradientBrush x:Key="gdLinearGradientBrush" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Red" Offset