|
@@ -54,6 +54,12 @@ namespace PDF_Office.CustomControl.CompositeControl
|
|
|
{
|
|
|
Color = defaultColor;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//类说明:
|
|
@@ -67,6 +73,31 @@ namespace PDF_Office.CustomControl.CompositeControl
|
|
|
private ObservableCollection<ColorItem> colors = new ObservableCollection<ColorItem>();
|
|
|
public event EventHandler<Color> SelectedColorHandler;
|
|
|
private ColorItem ChangedColorItem;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 选中项的颜色
|
|
|
+ /// </summary>
|
|
|
+ public Color SelectedColor
|
|
|
+ {
|
|
|
+ get { return (Color)GetValue(SelectedColorProperty); }
|
|
|
+ set { SetValue(SelectedColorProperty, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static readonly DependencyProperty SelectedColorProperty =
|
|
|
+ DependencyProperty.Register("SelectedColor", typeof(Color), typeof(ColorContent), new PropertyMetadata((Color)ColorConverter.ConvertFromString("#6C33F8CC")));
|
|
|
+
|
|
|
+
|
|
|
+ public Visibility ShowColorList
|
|
|
+ {
|
|
|
+ get { return (Visibility)GetValue(ShowColorListProperty); }
|
|
|
+ set { SetValue(ShowColorListProperty, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Using a DependencyProperty as the backing store for ShowColorList. This enables animation, styling, binding, etc...
|
|
|
+ public static readonly DependencyProperty ShowColorListProperty =
|
|
|
+ DependencyProperty.Register("ShowColorList", typeof(Visibility), typeof(ColorContent), new PropertyMetadata(Visibility.Visible));
|
|
|
+
|
|
|
+
|
|
|
public ColorContent()
|
|
|
{
|
|
|
InitializeComponent();
|
|
@@ -81,7 +112,8 @@ namespace PDF_Office.CustomControl.CompositeControl
|
|
|
{
|
|
|
IsExistForContainer((ElcustomColor.Fill as SolidColorBrush).Color);
|
|
|
SelectedColorHandler?.Invoke(this, e.Value);
|
|
|
- ElcustomColor.Fill = new SolidColorBrush(e.Value);
|
|
|
+ //ElcustomColor.Fill = new SolidColorBrush(e.Value);
|
|
|
+ SelectedColor = e.Value;
|
|
|
}
|
|
|
|
|
|
private void ListColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
|