首页 > 代码库 > XAML 资源
XAML 资源
http://msdn.microsoft.com/zh-cn/library/ms750613.aspx
<Page Name="root" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Page.Resources> <SolidColorBrush x:Key="MyBrush" Color="Gold"/> <Style TargetType="Border" x:Key="PageBackground"> <Setter Property="Background" Value="http://www.mamicode.com/Blue"/> </Style> <Style TargetType="TextBlock" x:Key="TitleText"> <Setter Property="Background" Value="http://www.mamicode.com/Blue"/> <Setter Property="DockPanel.Dock" Value="http://www.mamicode.com/Top"/> <Setter Property="FontSize" Value="http://www.mamicode.com/18"/> <Setter Property="Foreground" Value="http://www.mamicode.com/#4E87D4"/> <Setter Property="FontFamily" Value="http://www.mamicode.com/Trebuchet MS"/> <Setter Property="Margin" Value="http://www.mamicode.com/0,40,10,10"/> </Style> <Style TargetType="TextBlock" x:Key="Label"> <Setter Property="DockPanel.Dock" Value="http://www.mamicode.com/Right"/> <Setter Property="FontSize" Value="http://www.mamicode.com/8"/> <Setter Property="Foreground" Value="http://www.mamicode.com/{StaticResource MyBrush}"/> <Setter Property="FontFamily" Value="http://www.mamicode.com/Arial"/> <Setter Property="FontWeight" Value="http://www.mamicode.com/Bold"/> <Setter Property="Margin" Value="http://www.mamicode.com/0,3,10,0"/> </Style> </Page.Resources> <StackPanel> <Border Style="{StaticResource PageBackground}"> <DockPanel> <TextBlock Style="{StaticResource TitleText}">Title</TextBlock> <TextBlock Style="{StaticResource Label}">Label</TextBlock> <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" FontSize="36" Foreground="{StaticResource MyBrush}" Text="Text" Margin="20" /> <Button DockPanel.Dock="Top" HorizontalAlignment="Left" Height="30" Background="{StaticResource MyBrush}" Margin="40">Button</Button> <Ellipse DockPanel.Dock="Top" HorizontalAlignment="Left" Width="100" Height="100" Fill="{StaticResource MyBrush}" Margin="40" /> </DockPanel> </Border> </StackPanel></Page>
XAML 资源
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。