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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<Window x:Class="WinItemsRenderThread.WinLoadDGV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WinItemsRenderThread"
Title="WinLoadDGV" Height="300" Width="300">
<Window.Resources>
<Style
x:Key="styleTB"
TargetType="TextBlock">
<Setter Property="Foreground" Value="Transparent"/>
<Setter Property="Background" Value="Transparent"/>
<Style.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<ColorAnimation
Storyboard.TargetProperty="(TextBlock.Background).(SolidColorBrush.Color)"
Duration="00:00:03"
From="Red" To="Transparent" />
</Storyboard>
</BeginStoryboard>
<BeginStoryboard>
<Storyboard>
<ColorAnimation
Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
Duration="00:00:03"
From="Transparent" To="DarkBlue" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<StackPanel>
<StackPanel
Orientation="Horizontal">
<Button Content="Start"
Click="startButton_Click"
Name="startButton"
Margin="5,0,5,0"
/>
<TextBlock
Margin="10,5,0,0"
Text ="Item Added : ">
</TextBlock >
<TextBlock
Name="tbNextItem"
Margin="4,5,0,0"
Text="0">
</TextBlock>
</StackPanel>
<DataGrid
x:Name="dgv"
VirtualizingStackPanel.VirtualizationMode="Standard"
AutoGenerateColumns="False"
ItemsSource="{Binding}"
>
<DataGrid.Columns>
<DataGridTextColumn
Header="FirstName"
Binding="{Binding FName}"
/>
<DataGridTextColumn
Header="Last Name"
Binding="{Binding LName}"
ElementStyle="{StaticResource styleTB}"/>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Window> |
Partager