TextChanged="NumberBoxTextChanged"\r
VerticalContentAlignment="Center"/>\r
<Grid\r
- Name="incrementButtonsGrid"\r
+ Name="upButton"\r
Grid.Column="1"\r
Width="16">\r
<Grid.RowDefinitions>\r
<RowDefinition Height="*" />\r
<RowDefinition Height="*" />\r
</Grid.RowDefinitions>\r
- <Button\r
+ <Button x:Name="incrementButtonsGrid"\r
Style="{StaticResource UpButton}"\r
Grid.Row="0"\r
FontSize="4"\r
PreviewMouseLeftButtonDown="UpButtonMouseLeftButtonDown"\r
- PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp">\r
+ PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp"\r
+ PreviewKeyDown="UpButton_OnKeyDown">\r
<Polygon\r
Style="{StaticResource Arrow}"\r
Points="4,0 0,4 8,4" />\r
</Button>\r
- <Button\r
+ <Button x:Name="deIncrementButtonsGrid"\r
Style="{StaticResource DownButton}"\r
Grid.Row="1"\r
FontSize="4"\r
PreviewMouseLeftButtonDown="DownButtonMouseLeftButtonDown"\r
- PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp">\r
+ PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp"\r
+ PreviewKeyDown="DownButton_OnKeyDown">\r
<Polygon\r
Style="{StaticResource Arrow}"\r
Points="0,0 8,0 4,4" />\r
\r
this.UpdateNumberBindingFromBox();\r
}\r
-\r
- this.RefreshNumberBoxColor();\r
}\r
\r
/// <summary>\r
if (this.AllowEmpty && this.Number == 0)\r
{\r
this.numberBox.Text = this.hasFocus ? string.Empty : this.NoneCaption;\r
-\r
- // this.numberBox.Foreground = new SolidColorBrush(Colors.Gray);\r
}\r
else\r
{\r
{\r
this.numberBox.Text = this.Number.ToString(CultureInfo.InvariantCulture);\r
}\r
-\r
- // this.numberBox.Foreground = new SolidColorBrush(Colors.Black);\r
}\r
-\r
- this.RefreshNumberBoxColor();\r
- }\r
-\r
- /// <summary>\r
- /// The refresh number box color.\r
- /// </summary>\r
- private void RefreshNumberBoxColor()\r
- {\r
- this.numberBox.Foreground = this.numberBox.Text == this.NoneCaption ? new SolidColorBrush(Colors.Gray) : new SolidColorBrush(Colors.Black);\r
}\r
\r
/// <summary>\r
}\r
\r
#endregion\r
+\r
+ private void UpButton_OnKeyDown(object sender, KeyEventArgs e)\r
+ {\r
+ if (e.Key == Key.Space)\r
+ {\r
+ this.IncrementNumber();\r
+ }\r
+ }\r
+\r
+ private void DownButton_OnKeyDown(object sender, KeyEventArgs e)\r
+ {\r
+ if (e.Key == Key.Space)\r
+ {\r
+ this.DecrementNumber();\r
+ }\r
+ }\r
}\r
}
\ No newline at end of file
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
</Style>
+ <!-- Glyph -->
+ <SolidColorBrush x:Key="GlyphBrush" Color="WhiteSmoke"/>
+
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Controls/ComboBoxDark.xaml" />
<ResourceDictionary Source="Controls/ButtonDark.xaml" />
\r
<StackPanel Orientation="Horizontal" Grid.Column="6" Margin="5,0,0,0">\r
<TextBlock Text="Name: " FontWeight="Bold" Margin="0,0,5,0" VerticalAlignment="Center" />\r
- <TextBox x:Name="TrackName" Text="{Binding Name}" Grid.Column="10" Width="120" />\r
+ <TextBox x:Name="TrackName" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Grid.Column="10" Width="120" />\r
</StackPanel>\r
</Grid>\r
\r
\r
<StackPanel Orientation="Horizontal" Grid.Column="10" Margin="5,0,0,0">\r
<TextBlock Text="Name: " FontWeight="Bold" Margin="0,0,5,0" />\r
- <TextBox x:Name="TrackNameSrt" Text="{Binding Name}" Grid.Column="10" Width="120" />\r
+ <TextBox x:Name="TrackNameSrt" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Grid.Column="10" Width="120" />\r
</StackPanel>\r
\r
</Grid>\r