1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
<Window x:Class="WpfButton.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<DockPanel x:Key="vis">
<Rectangle Fill="#FF808080" Width="1" DockPanel.Dock="Left"/>
<Rectangle Fill="#FF808080" Width="1" DockPanel.Dock="Right"/>
<Rectangle Fill="#FF808080" Height="1" DockPanel.Dock="Top"/>
<Rectangle Fill="#FF3F5DA3" Height="2" DockPanel.Dock="Top"/>
<Rectangle>
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFD4D4D4" Offset="0"/>
<GradientStop Color="#FFB0B0B0" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</DockPanel>
</Window.Resources>
<Grid>
<Button
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
BorderBrush="{x:Null}" BorderThickness="0.0" Width="200" Height="120">
<Button.Background>
<VisualBrush
Viewport="0.0,0.0,1.0,1.0"
ViewportUnits="RelativeToBoundingBox"
Visual="{StaticResource vis}" />
</Button.Background>
</Button>
</Grid>
</Window> |
Partager