|
@@ -1,32 +1,32 @@
|
|
|
-using System.Windows;
|
|
|
+using System.Windows;
|
|
|
+using System.Windows.Controls;
|
|
|
using System.Windows.Data;
|
|
|
-using System.Windows.Interactivity;
|
|
|
+using System.Windows.Interactivity;
|
|
|
using System.Windows.Media;
|
|
|
using ColorPicker;
|
|
|
-using PixiEditor.Helpers.Behaviours;
|
|
|
-using PixiEditor.Views;
|
|
|
-
|
|
|
+using PixiEditor.Helpers.Behaviours;
|
|
|
+using PixiEditor.Views;
|
|
|
+
|
|
|
namespace PixiEditor.Models.Tools.ToolSettings.Settings
|
|
|
{
|
|
|
public class ColorSetting : Setting<Color>
|
|
|
{
|
|
|
- public ColorSetting(string name, string label = "")
|
|
|
+ public ColorSetting(string name, string label = "")
|
|
|
: base(name)
|
|
|
{
|
|
|
Label = label;
|
|
|
- SettingControl = GenerateColorPicker();
|
|
|
Value = Color.FromArgb(255, 255, 255, 255);
|
|
|
}
|
|
|
|
|
|
private ToolSettingColorPicker GenerateColorPicker()
|
|
|
{
|
|
|
var resourceDictionary = new ResourceDictionary();
|
|
|
- resourceDictionary.Source = new System.Uri(
|
|
|
- "pack://application:,,,/ColorPicker;component/Styles/DefaultColorPickerStyle.xaml",
|
|
|
+ resourceDictionary.Source = new System.Uri(
|
|
|
+ "pack://application:,,,/ColorPicker;component/Styles/DefaultColorPickerStyle.xaml",
|
|
|
System.UriKind.RelativeOrAbsolute);
|
|
|
- ToolSettingColorPicker picker = new ToolSettingColorPicker
|
|
|
- {
|
|
|
- Style = (Style)resourceDictionary["DefaultColorPickerStyle"]
|
|
|
+ ToolSettingColorPicker picker = new ToolSettingColorPicker
|
|
|
+ {
|
|
|
+ Style = (Style)resourceDictionary["DefaultColorPickerStyle"]
|
|
|
};
|
|
|
|
|
|
Binding selectedColorBinding = new Binding("Value")
|
|
@@ -39,5 +39,10 @@ namespace PixiEditor.Models.Tools.ToolSettings.Settings
|
|
|
picker.SetBinding(ToolSettingColorPicker.SelectedColorProperty, selectedColorBinding);
|
|
|
return picker;
|
|
|
}
|
|
|
+
|
|
|
+ public override Control GenerateControl()
|
|
|
+ {
|
|
|
+ return GenerateColorPicker();
|
|
|
+ }
|
|
|
}
|
|
|
}
|