标签:找不到 art free 列表 nfx 多个 content sources 根据
<Window.Resources> <ImageBrush x:Key="TitleBrush" TileMode="Tile" ViewboxUnits="Absolute" Viewport="0 0 32 32"ImageSource="" Opacity="0.3"></ImageBrush> </Window.Resources> <StackPanel> <Button Background="{StaticResource TitleBrush}">Requery</Button> </StackPanel>
<Window.Resources> <ImageBrush x:Key="TitleBrush" TileMode="Tile" ViewboxUnits="Absolute" Viewport="0 0 32 32" ImageSource="happyface.jpg" Opacity="0.3"></ImageBrush> </Window.Resources> <StackPanel> <Button Background="{StaticResource TitleBrush}">Requery</Button> <Button Background="{DynamicResource TitleBrush}"> <Button.Resources> <ImageBrush x:Key="TitleBrush" TileMode="Tile" ViewboxUnits="Absolute" Viewport="0 0 32 32" ImageSource="abc.jpg" Opacity="0.3"></ImageBrush> </Button.Resources> <Button.Content>Another Titled Button</Button.Content> </Button> </StackPanel>
ImageBrush brush=(ImageBrush)this.Resources["TitleBrush"]; brush.Viewport = new Rect(0,0,5,5);
this.Resources["TitleBrush"] = new SolidColorBrush(Colors.LightBlue);
<ImageBrush x:Key="TitleBrush" x:Shared="False" TileMode="Tile" ViewboxUnits="Absolute" Viewport="0 0 32 32" ImageSource="happyface.jpg" Opacity="0.3"></ImageBrush>
private void txt_TextChanged(object sender, RoutedEventArgs e) { Button cmd = (Button)sender; ImageBrush brush = (ImageBrush)cmd.FindResource("TitleBrush"); }
<Application x:Class="HelloWpf.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="GridDemoWindow.xaml"> <Application.Resources> <ImageBrush x:Key="TitleBrush" TileMode="Tile" ViewboxUnits="Absolute" Viewport="0 0 32 32" ImageSource="happyface.jpg" Opacity="0.3"></ImageBrush> </Application.Resources> </Application>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ImageBrush x:Key="TitleBrush" TileMode="Tile" ViewboxUnits="Absolute" Viewport="0 0 32 32" ImageSource="happyface.jpg" Opacity="0.3"></ImageBrush> </ResourceDictionary>
<Application x:Class="HelloWpf.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="GridDemoWindow.xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="AppBrushs.xaml"></ResourceDictionary> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>
标签:找不到 art free 列表 nfx 多个 content sources 根据
原文地址:https://www.cnblogs.com/lovezhangyu/p/10218298.html