Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| <Window x:Class="ControlsOverview.Window1" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| Title="ControlsOverview" Height="300" Width="400" | |
| > | |
| <Window.Resources> | |
| <!--<Snippet6>--> | |
| <!--Define a template that creates a gradient-colored button.--> | |
| <Style TargetType="Button"> | |
| <Setter Property="Template"> | |
| <Setter.Value> | |
| <ControlTemplate TargetType="Button"> | |
| <Border | |
| x:Name="Border" | |
| CornerRadius="20" | |
| BorderThickness="1" | |
| BorderBrush="Black"> | |
| <Border.Background> | |
| <LinearGradientBrush StartPoint="0,0.5" | |
| EndPoint="1,0.5"> | |
| <GradientStop Color="{Binding Background.Color, | |
| RelativeSource={RelativeSource TemplatedParent}}" | |
| Offset="0.0" /> | |
| <GradientStop Color="White" Offset="0.9" /> | |
| </LinearGradientBrush> | |
| </Border.Background> | |
| <ContentPresenter | |
| Margin="2" | |
| HorizontalAlignment="Center" | |
| VerticalAlignment="Center" | |
| RecognizesAccessKey="True"/> | |
| </Border> | |
| <ControlTemplate.Triggers> | |
| <!--Change the appearance of | |
| the button when the user clicks it.--> | |
| <Trigger Property="IsPressed" Value="true"> | |
| <Setter TargetName="Border" Property="Background"> | |
| <Setter.Value> | |
| <LinearGradientBrush StartPoint="0,0.5" | |
| EndPoint="1,0.5"> | |
| <GradientStop Color="{Binding Background.Color, | |
| RelativeSource={RelativeSource TemplatedParent}}" | |
| Offset="0.0" /> | |
| <GradientStop Color="DarkSlateGray" Offset="0.9" /> | |
| </LinearGradientBrush> | |
| </Setter.Value> | |
| </Setter> | |
| </Trigger> | |
| </ControlTemplate.Triggers> | |
| </ControlTemplate> | |
| </Setter.Value> | |
| </Setter> | |
| </Style> | |
| <!--</Snippet6>--> | |
| </Window.Resources> | |
| <Grid> | |
| <Grid.RowDefinitions> | |
| <RowDefinition Height="100"/> | |
| <RowDefinition Height="30"/> | |
| <RowDefinition /> | |
| <RowDefinition/> | |
| </Grid.RowDefinitions> | |
| <!--<Snippet1>--> | |
| <Grid> | |
| <Grid.RowDefinitions> | |
| <RowDefinition Height="30"/> | |
| <RowDefinition Height="30"/> | |
| <RowDefinition Height="30"/> | |
| <RowDefinition/> | |
| </Grid.RowDefinitions> | |
| <Grid.ColumnDefinitions> | |
| <ColumnDefinition/> | |
| <ColumnDefinition/> | |
| </Grid.ColumnDefinitions> | |
| <Label> | |
| Enter your first name: | |
| </Label> | |
| <TextBox Grid.Row="0" Grid.Column="1" | |
| Name="firstName" Margin="0,5,10,5"/> | |
| <Label Grid.Row="1" > | |
| Enter your last name: | |
| </Label> | |
| <TextBox Grid.Row="1" Grid.Column="1" | |
| Name="lastName" Margin="0,5,10,5"/> | |
| <Button Grid.Row="2" Grid.Column="0" | |
| Name="submit" Margin="2"> | |
| View message | |
| </Button> | |
| <Button Grid.Row="2" Grid.Column="1" | |
| Name="Clear" Margin="2"> | |
| Clear Name | |
| </Button> | |
| </Grid> | |
| <!--</Snippet1>--> | |
| <Grid Grid.Row="1"> | |
| <!--<Snippet10>--> | |
| <Button Grid.Row="2" Grid.ColumnSpan="2" Name="submitName" Click="submit_Click" | |
| Background="Green">View message</Button> | |
| <!--</Snippet10>--> | |
| </Grid> | |
| </Grid> | |
| </Window> |