|
@@ -4,7 +4,8 @@ using System.Windows.Data;
|
|
|
using System.Windows.Interactivity;
|
|
|
using PixiEditor.Helpers;
|
|
|
using PixiEditor.Helpers.Behaviours;
|
|
|
-
|
|
|
+using PixiEditor.Views;
|
|
|
+
|
|
|
namespace PixiEditor.Models.Tools.ToolSettings.Settings
|
|
|
{
|
|
|
public class SizeSetting : Setting<int>
|
|
@@ -17,32 +18,20 @@ namespace PixiEditor.Models.Tools.ToolSettings.Settings
|
|
|
Label = label;
|
|
|
}
|
|
|
|
|
|
- private TextBox GenerateTextBox()
|
|
|
+ private SizeInput GenerateTextBox()
|
|
|
{
|
|
|
- TextBox tb = new TextBox
|
|
|
+ SizeInput tb = new SizeInput
|
|
|
{
|
|
|
- TextAlignment = TextAlignment.Center,
|
|
|
- MaxLength = 4,
|
|
|
Width = 40,
|
|
|
- Height = 20
|
|
|
- };
|
|
|
-
|
|
|
- if (Application.Current != null)
|
|
|
- {
|
|
|
- tb.Style = (Style)Application.Current.TryFindResource("DarkTextBoxStyle");
|
|
|
- }
|
|
|
+ Height = 20,
|
|
|
+ FontSize = 12,
|
|
|
+ };
|
|
|
|
|
|
- Binding binding = new Binding("Value")
|
|
|
- {
|
|
|
- Converter = new ToolSizeToIntConverter(),
|
|
|
- Mode = BindingMode.TwoWay
|
|
|
- };
|
|
|
- tb.SetBinding(TextBox.TextProperty, binding);
|
|
|
- TextBoxFocusBehavior behavor = new TextBoxFocusBehavior
|
|
|
- {
|
|
|
- FillSize = true
|
|
|
+ Binding binding = new Binding("Value")
|
|
|
+ {
|
|
|
+ Mode = BindingMode.TwoWay,
|
|
|
};
|
|
|
- Interaction.GetBehaviors(tb).Add(behavor);
|
|
|
+ tb.SetBinding(SizeInput.SizeProperty, binding);
|
|
|
return tb;
|
|
|
}
|
|
|
}
|