/
BasicUI.xaml
148 lines (139 loc) · 8.42 KB
/
BasicUI.xaml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<ek:UIRoot xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ek="clr-namespace:EmptyKeys.UserInterface.Designer;assembly=EmptyKeys.UserInterface.Designer"
mc:Ignorable="d"
d:DesignHeight="640" d:DesignWidth="800" FontSize="10pt" ek:SoundManager.Sounds="{DynamicResource Sounds}" Background="Transparent">
<!-- User can define style for his root control -->
<!--ek:UIRoot.Style>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ek:UIRoot}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter Content="{TemplateBinding Content}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ek:UIRoot.Style-->
<ek:UIRoot.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/UserInterface;component/Dictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ek:UIRoot.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="110"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Background="Black" Grid.ColumnSpan="2">
<Image Name="logo" Stretch="None" HorizontalAlignment="Center" Source="{DynamicResource logoEmptyKeys}">
</Image>
<TextBlock TextWrapping="Wrap" Text="{DynamicResource TitleResource}" HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="15pt" FontWeight="Bold" FontFamily="Segoe UI" Foreground="LightGray" />
</StackPanel>
<StackPanel Grid.Row="1">
<ComboBox Name="combo" Width="200" Margin="5" ItemsSource="{Binding ComboBoxSource}" SelectedIndex="{Binding SelectedIndex}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Margin="2" Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button Name="button1" Content="1" Width="200" Height="30" Margin="5" Command="{Binding ButtonCommand}" CommandParameter="Click Button 1" ToolTip="Click Me!" />
<Button Name="button2" Style="{DynamicResource buttonStyle}" Content="2" Height="30" Margin="5" Command="{Binding ButtonCommand}" CommandParameter="Click Button 2"/>
<Button Name="button3" Content="3" Width="200" Height="30" Margin="5" FontSize="15pt" FontWeight="Bold" FontFamily="Segoe UI"
Command="{Binding OpenMessageBox}" CommandParameter="Click Button 3" ToolTip="{DynamicResource ToolTipText}"/>
<TextBlock Name="buttonResult" Text="{Binding ButtonResult}" HorizontalAlignment="Center" />
<Slider Name="slider" Width="200" Value="{Binding SliderValue}" Minimum="5" Maximum="20" />
<TextBox Name="textBox" Width="200" Text="{Binding TextBoxText}" Margin="5"/>
<CheckBox Name="checkBox" Margin="5" Content="Check Box" HorizontalAlignment="Center" />
<TabControl Width="400" Height="150">
<TabItem Header="Tab 1" HorizontalContentAlignment="Stretch">
<ListBox Height="100" ItemsSource="{Binding ComboBoxSource}" SelectedItem="{Binding SelectedItem}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Margin="2" Text="{Binding Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</TabItem>
<TabItem Header="Tab 2">
<StackPanel>
<ListBox Height="100">
<ListBoxItem>Selection 1</ListBoxItem>
<ListBoxItem>Selection 2</ListBoxItem>
<ListBoxItem>Selection 3</ListBoxItem>
<ListBoxItem>Selection 4</ListBoxItem>
</ListBox>
</StackPanel>
</TabItem>
<TabItem Header="Tab 3" Content="Tab 3 Content" />
<TabItem Header="Tab 4" Content="Tab 4 Content"/>
</TabControl>
<ProgressBar Value="39" Height="30" Margin="5" Width="400"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1">
<Button Name="animButton1" Style="{DynamicResource buttonAnimStyle}" Content="Mouse Over me!" />
<Button Name="animButton2" Style="{DynamicResource buttonAnimStyle}" Content="Mouse Over me!" />
<Button Name="animButton3" Style="{DynamicResource buttonAnimStyle}" Content="Mouse Over me!" />
<Button Name="animButton4" Style="{DynamicResource buttonAnimStyle}" Content="Mouse Over me!" />
<Grid>
<Border Name="animBorder1" Width="200" Height="100" Margin="0,10,0,10" >
<Border.Triggers>
<EventTrigger RoutedEvent="Border.Loaded">
<BeginStoryboard>
<Storyboard>
<ek:SolidColorBrushAnimation
Storyboard.TargetName="animBorder1"
Storyboard.TargetProperty="Background"
From="Yellow" To="Blue" Duration="0:0:5" AutoReverse="True"
RepeatBehavior="Forever">
<ek:SolidColorBrushAnimation.EasingFunction>
<ExponentialEase />
</ek:SolidColorBrushAnimation.EasingFunction>
</ek:SolidColorBrushAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
</Border>
<Border Name="animBorder2" Width="100" Height="50" Margin="50,35,50,35" >
<Border.Triggers>
<EventTrigger RoutedEvent="Border.Loaded">
<BeginStoryboard>
<Storyboard>
<ek:SolidColorBrushAnimation
Storyboard.TargetName="animBorder2"
Storyboard.TargetProperty="Background"
From="Red" To="White" Duration="0:0:3" AutoReverse="True"
RepeatBehavior="Forever">
<ek:SolidColorBrushAnimation.EasingFunction>
<CubicEase />
</ek:SolidColorBrushAnimation.EasingFunction>
</ek:SolidColorBrushAnimation>
<DoubleAnimation
Storyboard.TargetName="animBorder2"
Storyboard.TargetProperty="Opacity"
From="1" To="0" Duration="0:0:4" AutoReverse="True" RepeatBehavior="Forever">
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
</Border>
</Grid>
</StackPanel>
</Grid>
</ek:UIRoot>