diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml index 770971b8..eee997c1 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml @@ -164,15 +164,6 @@ - \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/car_chase.gif b/src/Shared/HandyControlDemo_Shared/Resources/Img/car_chase.gif index ff9290f2..51ac8c46 100644 Binary files a/src/Shared/HandyControlDemo_Shared/Resources/Img/car_chase.gif and b/src/Shared/HandyControlDemo_Shared/Resources/Img/car_chase.gif differ diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GifImageDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GifImageDemoCtl.xaml index 0b4a7597..49ee865b 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GifImageDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GifImageDemoCtl.xaml @@ -4,6 +4,6 @@ xmlns:hc="https://handyorg.github.io/handycontrol" Background="{DynamicResource RegionBrush}"> - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml index 21762990..22f8f9ba 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml @@ -6,9 +6,9 @@ Background="{DynamicResource RegionBrush}"> - + - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RunningBlockDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RunningBlockDemoCtl.xaml index da4df59c..f45e978e 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RunningBlockDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RunningBlockDemoCtl.xaml @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ExpanderDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ExpanderDemoCtl.xaml index 012bf1e9..33fc488e 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ExpanderDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ExpanderDemoCtl.xaml @@ -7,16 +7,16 @@ - + - + - + - + diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs index 1a39fbde..334a45ff 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs @@ -6,7 +6,7 @@ namespace HandyControl.Controls public class VisualElement { public static readonly DependencyProperty HighlightBrushProperty = DependencyProperty.RegisterAttached( - "HighlightBrush", typeof(Brush), typeof(VisualElement), new PropertyMetadata(default(Brush))); + "HighlightBrush", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits)); public static void SetHighlightBrush(DependencyObject element, Brush value) => element.SetValue(HighlightBrushProperty, value); @@ -14,6 +14,33 @@ namespace HandyControl.Controls public static Brush GetHighlightBrush(DependencyObject element) => (Brush) element.GetValue(HighlightBrushProperty); + public static readonly DependencyProperty HighlightBackgroundProperty = DependencyProperty.RegisterAttached( + "HighlightBackground", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetHighlightBackground(DependencyObject element, Brush value) + => element.SetValue(HighlightBackgroundProperty, value); + + public static Brush GetHighlightBackground(DependencyObject element) + => (Brush) element.GetValue(HighlightBackgroundProperty); + + public static readonly DependencyProperty HighlightBorderBrushProperty = DependencyProperty.RegisterAttached( + "HighlightBorderBrush", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetHighlightBorderBrush(DependencyObject element, Brush value) + => element.SetValue(HighlightBorderBrushProperty, value); + + public static Brush GetHighlightBorderBrush(DependencyObject element) + => (Brush) element.GetValue(HighlightBorderBrushProperty); + + public static readonly DependencyProperty HighlightForegroundProperty = DependencyProperty.RegisterAttached( + "HighlightForeground", typeof(Brush), typeof(VisualElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetHighlightForeground(DependencyObject element, Brush value) + => element.SetValue(HighlightForegroundProperty, value); + + public static Brush GetHighlightForeground(DependencyObject element) + => (Brush) element.GetValue(HighlightForegroundProperty); + public static readonly DependencyProperty TextProperty = DependencyProperty.RegisterAttached( "Text", typeof(string), typeof(VisualElement), new PropertyMetadata(default(string))); diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs b/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs index 985b7003..af9c2485 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs @@ -15,9 +15,9 @@ namespace HandyControl.Controls [TemplatePart(Name = ElementButtonLeft, Type = typeof(Button))] [TemplatePart(Name = ElementButtonRight, Type = typeof(Button))] [TemplatePart(Name = ElementButtonFirst, Type = typeof(RadioButton))] - [TemplatePart(Name = ElementTextBlockLeft, Type = typeof(TextBlock))] + [TemplatePart(Name = ElementMoreLeft, Type = typeof(FrameworkElement))] [TemplatePart(Name = ElementPanelMain, Type = typeof(Panel))] - [TemplatePart(Name = ElementTextBlockRight, Type = typeof(TextBlock))] + [TemplatePart(Name = ElementMoreRight, Type = typeof(FrameworkElement))] [TemplatePart(Name = ElementButtonLast, Type = typeof(RadioButton))] public class Pagination : Control { @@ -26,9 +26,9 @@ namespace HandyControl.Controls private const string ElementButtonLeft = "PART_ButtonLeft"; private const string ElementButtonRight = "PART_ButtonRight"; private const string ElementButtonFirst = "PART_ButtonFirst"; - private const string ElementTextBlockLeft = "PART_TextBlockLeft"; + private const string ElementMoreLeft = "PART_MoreLeft"; private const string ElementPanelMain = "PART_PanelMain"; - private const string ElementTextBlockRight = "PART_TextBlockRight"; + private const string ElementMoreRight = "PART_MoreRight"; private const string ElementButtonLast = "PART_ButtonLast"; #endregion Constants @@ -38,9 +38,9 @@ namespace HandyControl.Controls private Button _buttonLeft; private Button _buttonRight; private RadioButton _buttonFirst; - private TextBlock _textBlockLeft; + private FrameworkElement _moreLeft; private Panel _panelMain; - private TextBlock _textBlockRight; + private FrameworkElement _moreRight; private RadioButton _buttonLast; private bool _appliedTemplate; @@ -231,9 +231,9 @@ namespace HandyControl.Controls _buttonLeft = GetTemplateChild(ElementButtonLeft) as Button; _buttonRight = GetTemplateChild(ElementButtonRight) as Button; _buttonFirst = GetTemplateChild(ElementButtonFirst) as RadioButton; - _textBlockLeft = GetTemplateChild(ElementTextBlockLeft) as TextBlock; + _moreLeft = GetTemplateChild(ElementMoreLeft) as FrameworkElement; _panelMain = GetTemplateChild(ElementPanelMain) as Panel; - _textBlockRight = GetTemplateChild(ElementTextBlockRight) as TextBlock; + _moreRight = GetTemplateChild(ElementMoreRight) as FrameworkElement; _buttonLast = GetTemplateChild(ElementButtonLast) as RadioButton; CheckNull(); @@ -249,7 +249,7 @@ namespace HandyControl.Controls private void CheckNull() { if (_buttonLeft == null || _buttonRight == null || _buttonFirst == null || - _textBlockLeft == null || _panelMain == null || _textBlockRight == null || + _moreLeft == null || _panelMain == null || _moreRight == null || _buttonLast == null) throw new Exception(); } @@ -265,8 +265,8 @@ namespace HandyControl.Controls { _buttonFirst.Collapse(); _buttonLast.Collapse(); - _textBlockLeft.Collapse(); - _textBlockRight.Collapse(); + _moreLeft.Collapse(); + _moreRight.Collapse(); _panelMain.Children.Clear(); var selectButton = CreateButton(PageIndex); _panelMain.Children.Add(selectButton); @@ -275,8 +275,8 @@ namespace HandyControl.Controls } _buttonFirst.Show(); _buttonLast.Show(); - _textBlockLeft.Show(); - _textBlockRight.Show(); + _moreLeft.Show(); + _moreRight.Show(); //更新最后一页 if (MaxPageCount == 1) @@ -286,14 +286,14 @@ namespace HandyControl.Controls else { _buttonLast.Show(); - _buttonLast.Tag = MaxPageCount.ToString(); + _buttonLast.Content = MaxPageCount.ToString(); } //更新省略号 var right = MaxPageCount - PageIndex; var left = PageIndex - 1; - _textBlockRight.Show(right > MaxPageInterval); - _textBlockLeft.Show(left > MaxPageInterval); + _moreRight.Show(right > MaxPageInterval); + _moreLeft.Show(left > MaxPageInterval); //更新中间部分 _panelMain.Children.Clear(); @@ -347,7 +347,7 @@ namespace HandyControl.Controls return new RadioButton { Style = ResourceHelper.GetResource - + @@ -109,7 +109,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -246,9 +246,9 @@ - - - + + + @@ -272,7 +272,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Button.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Button.xaml index 7b0acfa1..e98001d7 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Button.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Button.xaml @@ -12,7 +12,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ButtonGroup.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ButtonGroup.xaml index 9db91779..1bab9e4d 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/ButtonGroup.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/ButtonGroup.xaml @@ -9,9 +9,9 @@ \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Pagination.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Pagination.xaml index 0a9f19ed..0534ab93 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Pagination.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Pagination.xaml @@ -1,99 +1,101 @@  + xmlns:interactivity="clr-namespace:HandyControl.Interactivity" + xmlns:system="clr-namespace:System;assembly=mscorlib"> - +