阅读背景:

wpf 分别用 xaml 和后台代码实现 色彩渐变

来源:互联网 

 

xaml 方法:

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid x:Name="grid1">
        <!--xaml中设置渐变效果-->
        
        <!--<Grid.Background>
            <LinearGradientBrush>
                <GradientStopCollection>
                    <GradientStop Offset="0" Color="Black" />
                    <GradientStop Offset="0.6" Color="white"  />
                </GradientStopCollection>
            </LinearGradientBrush>
        </Grid.Background>-->
    </Grid>
</Window><Window x:Class="WpfApplication1



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: