add Rate
This commit is contained in:
1 parent
7a6f293011
commit
95d19726eb
28 files changed
+634
-22
No files matched your search
@@ -4,6 +4,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Interactivity;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -152,7 +153,7 @@ namespace HandyControl.Controls
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
|
||||
"Value", typeof(double), typeof(NumericUpDown),
|
||||
new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
|
||||
OnValueChanged, CoerceValue), IsValidDoubleValue);
|
||||
OnValueChanged, CoerceValue), ArithmeticHelper.IsValidDoubleValue);
|
||||
|
||||
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -203,7 +204,7 @@ namespace HandyControl.Controls
|
||||
/// 最大值
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
|
||||
"Maximum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(100.0, OnMaximumChanged, CoerceMaximum), IsValidDoubleValue);
|
||||
"Maximum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(100.0, OnMaximumChanged, CoerceMaximum), ArithmeticHelper.IsValidDoubleValue);
|
||||
|
||||
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -231,7 +232,7 @@ namespace HandyControl.Controls
|
||||
/// 最小值
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
|
||||
"Minimum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(default(double), OnMinimumChanged, CoerceMinimum), IsValidDoubleValue);
|
||||
"Minimum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(default(double), OnMinimumChanged, CoerceMinimum), ArithmeticHelper.IsValidDoubleValue);
|
||||
|
||||
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -255,14 +256,6 @@ namespace HandyControl.Controls
|
||||
set => SetValue(MinimumProperty, value);
|
||||
}
|
||||
|
||||
private static bool IsValidDoubleValue(object value)
|
||||
{
|
||||
var d = (double)value;
|
||||
if (!double.IsNaN(d))
|
||||
return !double.IsInfinity(d);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 指示每单击一下按钮时增加或减少的数量
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class Rate : ItemsControl
|
||||
{
|
||||
private bool _isLoaded;
|
||||
|
||||
public Rate()
|
||||
{
|
||||
AddHandler(RateItem.SelectedChangedEvent, new RoutedEventHandler(RateItemSelectedChanged));
|
||||
AddHandler(RateItem.ValueChangedEvent, new RoutedEventHandler(RateItemValueChanged));
|
||||
|
||||
Loaded += (s, e) =>
|
||||
{
|
||||
if (_isLoaded) return;
|
||||
_isLoaded = true;
|
||||
if (Value <= 0)
|
||||
{
|
||||
if (DefaultValue > 0)
|
||||
{
|
||||
Value = DefaultValue;
|
||||
UpdateItems();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateItems();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void RateItemValueChanged(object sender, RoutedEventArgs e) => Value =
|
||||
(from RateItem item in Items where item.IsSelected select item.IsHalf ? 0.5 : 1).Sum();
|
||||
|
||||
private void RateItemSelectedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is RateItem rateItem)
|
||||
{
|
||||
var index = rateItem.Index;
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
if (Items[i] is RateItem item)
|
||||
{
|
||||
item.IsSelected = true;
|
||||
item.IsHalf = false;
|
||||
}
|
||||
}
|
||||
for (int i = index; i < Count; i++)
|
||||
{
|
||||
if (Items[i] is RateItem item)
|
||||
{
|
||||
item.IsSelected = false;
|
||||
item.IsHalf = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.Register(
|
||||
"ItemMargin", typeof(Thickness), typeof(Rate), new PropertyMetadata(default(Thickness)));
|
||||
|
||||
public Thickness ItemMargin
|
||||
{
|
||||
get => (Thickness)GetValue(ItemMarginProperty);
|
||||
set => SetValue(ItemMarginProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register(
|
||||
"ItemWidth", typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double20Box));
|
||||
|
||||
public double ItemWidth
|
||||
{
|
||||
get => (double)GetValue(ItemWidthProperty);
|
||||
set => SetValue(ItemWidthProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register(
|
||||
"ItemHeight", typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double20Box));
|
||||
|
||||
public double ItemHeight
|
||||
{
|
||||
get => (double)GetValue(ItemHeightProperty);
|
||||
set => SetValue(ItemHeightProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AllowHalfProperty = DependencyProperty.Register(
|
||||
"AllowHalf", typeof(bool), typeof(Rate), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool AllowHalf
|
||||
{
|
||||
get => (bool)GetValue(AllowHalfProperty);
|
||||
set => SetValue(AllowHalfProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AllowClearProperty = DependencyProperty.Register(
|
||||
"AllowClear", typeof(bool), typeof(Rate), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||
|
||||
public bool AllowClear
|
||||
{
|
||||
get => (bool)GetValue(AllowClearProperty);
|
||||
set => SetValue(AllowClearProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
|
||||
"Icon", typeof(Geometry), typeof(Rate), new PropertyMetadata(default(Geometry)));
|
||||
|
||||
public Geometry Icon
|
||||
{
|
||||
get => (Geometry)GetValue(IconProperty);
|
||||
set => SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty CountProperty = DependencyProperty.Register(
|
||||
"Count", typeof(int), typeof(Rate), new PropertyMetadata(ValueBoxes.Int5Box));
|
||||
|
||||
public int Count
|
||||
{
|
||||
get => (int)GetValue(CountProperty);
|
||||
set => SetValue(CountProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register(
|
||||
"DefaultValue", typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||
|
||||
public double DefaultValue
|
||||
{
|
||||
get => (double)GetValue(DefaultValueProperty);
|
||||
set => SetValue(DefaultValueProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
|
||||
"Value", typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||
|
||||
public double Value
|
||||
{
|
||||
get => (double)GetValue(ValueProperty);
|
||||
set => SetValue(ValueProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
|
||||
"Text", typeof(string), typeof(Rate), new PropertyMetadata(default(string)));
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => (string)GetValue(TextProperty);
|
||||
set => SetValue(TextProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register(
|
||||
"ShowText", typeof(bool), typeof(Rate), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool ShowText
|
||||
{
|
||||
get => (bool)GetValue(ShowTextProperty);
|
||||
set => SetValue(ShowTextProperty, value);
|
||||
}
|
||||
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is RateItem;
|
||||
|
||||
protected override DependencyObject GetContainerForItemOverride() => new RateItem();
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
if (!_isLoaded)
|
||||
{
|
||||
Items.Clear();
|
||||
|
||||
for (int i = 1; i <= Count; i++)
|
||||
{
|
||||
Items.Add(new RateItem
|
||||
{
|
||||
Index = i
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
UpdateItems();
|
||||
}
|
||||
|
||||
private void UpdateItems()
|
||||
{
|
||||
var count = (int)Value;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (Items[i] is RateItem rateItem)
|
||||
{
|
||||
rateItem.IsSelected = true;
|
||||
rateItem.IsHalf = false;
|
||||
}
|
||||
}
|
||||
if (Value > count)
|
||||
{
|
||||
if (Items[count] is RateItem rateItem)
|
||||
{
|
||||
rateItem.IsSelected = true;
|
||||
rateItem.IsHalf = true;
|
||||
}
|
||||
count += 1;
|
||||
}
|
||||
for (int i = count; i < Count; i++)
|
||||
{
|
||||
if (Items[i] is RateItem rateItem)
|
||||
{
|
||||
rateItem.IsSelected = false;
|
||||
rateItem.IsHalf = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset() => Value = DefaultValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
[TemplatePart(Name = ElementIcon, Type = typeof(FrameworkElement))]
|
||||
public class RateItem : Control
|
||||
{
|
||||
private const string ElementIcon = "PART_Icon";
|
||||
|
||||
private FrameworkElement _icon;
|
||||
|
||||
private bool _isLoaded;
|
||||
|
||||
private bool _isSentValue;
|
||||
|
||||
private bool _isMouseLeftButtonDown;
|
||||
|
||||
public RateItem() => Loaded += (s, e) => _isLoaded = true;
|
||||
|
||||
public static readonly DependencyProperty AllowClearProperty = DependencyProperty.Register(
|
||||
"AllowClear", typeof(bool), typeof(RateItem), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||
|
||||
public bool AllowClear
|
||||
{
|
||||
get => (bool)GetValue(AllowClearProperty);
|
||||
set => SetValue(AllowClearProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AllowHalfProperty = DependencyProperty.Register(
|
||||
"AllowHalf", typeof(bool), typeof(RateItem), new PropertyMetadata(ValueBoxes.FalseBox, OnAllowHalfChanged));
|
||||
|
||||
private static void OnAllowHalfChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (RateItem)d;
|
||||
ctl.HandleMouseMoveEvent((bool)e.NewValue);
|
||||
}
|
||||
|
||||
public bool AllowHalf
|
||||
{
|
||||
get => (bool)GetValue(AllowHalfProperty);
|
||||
set => SetValue(AllowHalfProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
|
||||
"Icon", typeof(Geometry), typeof(RateItem), new PropertyMetadata(default(Geometry)));
|
||||
|
||||
public Geometry Icon
|
||||
{
|
||||
get => (Geometry)GetValue(IconProperty);
|
||||
set => SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
internal static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
|
||||
"IsSelected", typeof(bool), typeof(RateItem), new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged));
|
||||
|
||||
private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (RateItem)d;
|
||||
ctl._icon.Show((bool)e.NewValue);
|
||||
}
|
||||
|
||||
internal bool IsSelected
|
||||
{
|
||||
get => (bool)GetValue(IsSelectedProperty);
|
||||
set => SetValue(IsSelectedProperty, value);
|
||||
}
|
||||
|
||||
public static readonly RoutedEvent SelectedChangedEvent =
|
||||
EventManager.RegisterRoutedEvent("SelectedChanged", RoutingStrategy.Bubble,
|
||||
typeof(RoutedEventHandler), typeof(RateItem));
|
||||
|
||||
public event RoutedEventHandler SelectedChanged
|
||||
{
|
||||
add => AddHandler(SelectedChangedEvent, value);
|
||||
remove => RemoveHandler(SelectedChangedEvent, value);
|
||||
}
|
||||
|
||||
public static readonly RoutedEvent ValueChangedEvent =
|
||||
EventManager.RegisterRoutedEvent("ValueChanged", RoutingStrategy.Bubble,
|
||||
typeof(RoutedEventHandler), typeof(RateItem));
|
||||
|
||||
public event RoutedEventHandler ValueChanged
|
||||
{
|
||||
add => AddHandler(ValueChangedEvent, value);
|
||||
remove => RemoveHandler(ValueChangedEvent, value);
|
||||
}
|
||||
|
||||
private bool _isHalf;
|
||||
|
||||
internal bool IsHalf
|
||||
{
|
||||
get => _isHalf;
|
||||
set
|
||||
{
|
||||
if (_isHalf == value) return;
|
||||
_isHalf = value;
|
||||
_icon.Width = value ? ActualWidth / 2 : ActualWidth;
|
||||
}
|
||||
}
|
||||
|
||||
internal int Index { get; set; }
|
||||
|
||||
private void HandleMouseMoveEvent(bool handle)
|
||||
{
|
||||
if (handle)
|
||||
{
|
||||
MouseMove += RateItem_MouseMove;
|
||||
}
|
||||
else
|
||||
{
|
||||
MouseMove -= RateItem_MouseMove;
|
||||
}
|
||||
}
|
||||
|
||||
private void RateItem_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!AllowHalf) return;
|
||||
var p = e.GetPosition(this);
|
||||
IsHalf = p.X < ActualWidth / 2;
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
_icon = GetTemplateChild(ElementIcon) as FrameworkElement;
|
||||
|
||||
if (_isLoaded)
|
||||
{
|
||||
if (_icon == null) return;
|
||||
_icon.Show(IsSelected);
|
||||
_icon.Width = IsHalf ? ActualWidth / 2 : ActualWidth;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseEnter(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseEnter(e);
|
||||
|
||||
_isSentValue = false;
|
||||
IsSelected = true;
|
||||
RaiseEvent(new RoutedEventArgs(SelectedChangedEvent) { Source = this });
|
||||
}
|
||||
|
||||
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
|
||||
_isMouseLeftButtonDown = true;
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
_isMouseLeftButtonDown = false;
|
||||
}
|
||||
|
||||
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonUp(e);
|
||||
|
||||
if (_isMouseLeftButtonDown)
|
||||
{
|
||||
if (Index == 1 && AllowClear)
|
||||
{
|
||||
if (IsSelected)
|
||||
{
|
||||
if (!_isSentValue)
|
||||
{
|
||||
RaiseEvent(new RoutedEventArgs(ValueChangedEvent) {Source = this});
|
||||
_isMouseLeftButtonDown = false;
|
||||
_isSentValue = true;
|
||||
return;
|
||||
}
|
||||
_isSentValue = false;
|
||||
IsSelected = false;
|
||||
IsHalf = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsSelected = true;
|
||||
if (AllowHalf)
|
||||
{
|
||||
var p = e.GetPosition(this);
|
||||
IsHalf = p.X < ActualWidth / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RaiseEvent(new RoutedEventArgs(ValueChangedEvent) {Source = this});
|
||||
_isMouseLeftButtonDown = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,17 +13,18 @@ namespace HandyControl.Controls
|
||||
EnableBlur(this);
|
||||
}
|
||||
|
||||
public static SystemVersionInfo SystemVersionInfo { get; set; }
|
||||
|
||||
internal static void EnableBlur(Window window)
|
||||
{
|
||||
var accentPolicy = new ExternDllHelper.ACCENTPOLICY();
|
||||
var accentPolicySize = Marshal.SizeOf(accentPolicy);
|
||||
var versionInfo = CommonHelper.GetSystemVersionInfo();
|
||||
|
||||
if (versionInfo >= SystemVersionInfo.Windows10_1809)
|
||||
if (SystemVersionInfo >= SystemVersionInfo.Windows10_1809)
|
||||
{
|
||||
accentPolicy.AccentState = ExternDllHelper.ACCENTSTATE.ACCENT_ENABLE_ACRYLICBLURBEHIND;
|
||||
}
|
||||
else if (versionInfo >= SystemVersionInfo.Windows10)
|
||||
else if (SystemVersionInfo >= SystemVersionInfo.Windows10)
|
||||
{
|
||||
accentPolicy.AccentState = ExternDllHelper.ACCENTSTATE.ACCENT_ENABLE_BLURBEHIND;
|
||||
}
|
||||
@@ -33,7 +34,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
accentPolicy.AccentFlags = 2;
|
||||
accentPolicy.GradientColor = ResourceHelper.GetResource<uint>("BlurGradientValue");
|
||||
accentPolicy.GradientColor = ResourceHelper.GetResource<uint>(ResourceToken.BlurGradientValue);
|
||||
|
||||
var accentPtr = Marshal.AllocHGlobal(accentPolicySize);
|
||||
Marshal.StructureToPtr(accentPolicy, accentPtr, false);
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
public static readonly string ThirdlyTextBrush = nameof(ThirdlyTextBrush);
|
||||
|
||||
public static readonly string BlurGradientValue = nameof(BlurGradientValue);
|
||||
|
||||
public static readonly string ButtonCustom = nameof(ButtonCustom);
|
||||
|
||||
public static readonly string PaginationButtonStyle = nameof(PaginationButtonStyle);
|
||||
|
||||
@@ -20,7 +20,8 @@ var brushList = new List<string>
|
||||
"WarningBrush",
|
||||
"AccentBrush",
|
||||
"PrimaryTextBrush",
|
||||
"ThirdlyTextBrush"
|
||||
"ThirdlyTextBrush",
|
||||
"BlurGradientValue"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
internal static object Double1Box = 1.0;
|
||||
|
||||
internal static object Double20Box = 20.0;
|
||||
|
||||
internal static object Double100Box = 100.0;
|
||||
|
||||
internal static object DoubleNeg1Box = -1.0;
|
||||
@@ -21,6 +23,8 @@
|
||||
|
||||
internal static object Int1Box = 1;
|
||||
|
||||
internal static object Int5Box = 5;
|
||||
|
||||
internal static object BooleanBox(bool value) => value ? TrueBox : FalseBox;
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,8 @@
|
||||
<Compile Include="Controls\Other\CirclePanel.cs" />
|
||||
<Compile Include="Controls\Other\CircleProgressBar.cs" />
|
||||
<Compile Include="Controls\Other\RadioGroup.cs" />
|
||||
<Compile Include="Controls\Rate\Rate.cs" />
|
||||
<Compile Include="Controls\Rate\RateItem.cs" />
|
||||
<Compile Include="Controls\Text\OutlineText.cs" />
|
||||
<Compile Include="Controls\Other\GifImage.cs" />
|
||||
<Compile Include="Controls\Input\SearchBar.cs" />
|
||||
@@ -200,7 +202,6 @@
|
||||
<Compile Include="Expression\Media\UnitType.cs" />
|
||||
<Compile Include="Expression\Shapes\Arc.cs" />
|
||||
<Compile Include="Expression\Shapes\PrimitiveShape.cs" />
|
||||
<Compile Include="Tools\Helper\CommonHelper.cs" />
|
||||
<Compile Include="Tools\Helper\ExternDllHelper.cs" />
|
||||
<Compile Include="Tools\Helper\SingleOpenHelper.cs" />
|
||||
<Compile Include="Controls\TabControl\TabControl.cs" />
|
||||
@@ -575,6 +576,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\Rate.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\Base\RateBaseStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\RichTextBox.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -667,7 +676,6 @@
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
@@ -701,6 +709,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<Geometry x:Key="WindowMinGeometry">M0,4 L10,4 L10,5 L0,5 z</Geometry>
|
||||
<Geometry x:Key="WindowRestoreGeometry">M1,3 L1,9 L7,9 L7,3 z M3,1 L3,2 L8,2 L8,7 L9,7 L9,1 z M2,0 L10,0 L10,8 L8,8 L8,10 L0,10 L0,2 L2,2 z</Geometry>
|
||||
<Geometry x:Key="WindowMaxGeometry">M1,1 L1,9 L9,9 L9,1 z M0,0 L10,0 L10,10 L0,10 z</Geometry>
|
||||
<Geometry x:Key="StarGeometry">M535.9 165.2l96.5 195.4c3.9 7.9 11.4 13.3 20.1 14.6l215.7 31.3c21.9 3.2 30.6 30 14.8 45.5L726.8 604.1c-6.3 6.1-9.1 14.9-7.7 23.6L756 842.5c3.7 21.8-19.1 38.4-38.7 28.1L524.4 769.2c-7.8-4.1-17-4.1-24.8 0L306.7 870.6c-19.6 10.3-42.4-6.3-38.7-28.1l36.8-214.8c1.5-8.6-1.4-17.5-7.7-23.6L141.1 452c-15.8-15.4-7.1-42.3 14.8-45.5l215.7-31.3c8.7-1.3 16.2-6.7 20.1-14.6l96.5-195.4c9.7-19.9 37.9-19.9 47.7 0z</Geometry>
|
||||
<Geometry x:Key="AddGeometry">M938.666667 426.666667h-341.333334V85.333333c0-46.933333-38.4-85.333333-85.333333-85.333333s-85.333333 38.4-85.333333 85.333333v341.333334H85.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333s38.4 85.333333 85.333333 85.333333h341.333334v341.333334c0 46.933333 38.4 85.333333 85.333333 85.333333s85.333333-38.4 85.333333-85.333333v-341.333334h341.333334c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333z</Geometry>
|
||||
<Geometry x:Key="SubGeometry">M62.5797 488.9508c0.2632 42.5185 34.985 77.2116 77.5035 77.5035l743.0216-0.6728c42.5185 0.3215 76.7437-33.9333 76.4518-76.4805l0 0c-0.2918-42.5175-34.985-77.2106-77.5045-77.5035l-743.0216-0.087C96.513 411.4473 62.2879 446.4323 62.5797 488.9508L62.5797 488.9508z</Geometry>
|
||||
<Geometry x:Key="WarningGeometry">M943.644188 827.215696l-351.176649-608.204749c-42.945473-74.36249-113.147387-74.36249-156.092861 0l-351.176649 608.204749c-42.946498 74.431167-7.811716 135.14955 78.012605 135.14955l702.420949 0C951.455904 962.36422 986.555836 901.645838 943.644188 827.215696zM466.187532 391.579035c12.621133-13.644108 28.66175-20.466675 48.233578-20.466675 19.580028 0 35.612444 6.75389 48.241778 20.194018 12.544256 13.473954 18.820484 30.325365 18.820484 50.587035 0 17.430551-26.19759 145.621205-34.929778 238.882082l-63.105666 0c-7.666162-93.259852-36.090106-221.450507-36.090106-238.882082C447.358847 421.938226 453.643275 405.155491 466.187532 391.579035zM561.76804 835.026386c-13.268949 12.928641-29.062535 19.375023-47.345906 19.375023-18.275171 0-34.076957-6.447407-47.346931-19.375023-13.235123-12.89379-19.818859-28.517221-19.818859-46.869269 0-18.249546 6.583736-34.043131 19.818859-47.278254 13.268949-13.235123 29.07176-19.852685 47.346931-19.852685 18.283371 0 34.076957 6.617562 47.345906 19.852685 13.235123 13.235123 19.827059 29.028709 19.827059 47.278254C581.595099 806.51019 575.003163 822.132597 561.76804 835.026386z</Geometry>
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../../Basic/Geometries.xaml"/>
|
||||
<ResourceDictionary Source="../../Basic/Converters.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="RateRateItemBaseStyle" TargetType="controls:RateItem">
|
||||
<Setter Property="Margin" Value="{Binding ItemMargin,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="AllowHalf" Value="{Binding AllowHalf,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="AllowClear" Value="{Binding AllowClear,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Icon" Value="{Binding Icon,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Background" Value="{Binding Background,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Foreground" Value="{Binding Foreground,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:RateItem">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard x:Key="OnMouseEnter">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="CanvasRoot">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="1.1"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="CanvasRoot">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="1.1"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="OnMouseLeave">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="CanvasRoot">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="CanvasRoot">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Canvas x:Name="CanvasRoot" RenderTransformOrigin="0.5,0.5">
|
||||
<Canvas.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
</TransformGroup>
|
||||
</Canvas.RenderTransform>
|
||||
<Path Width="{Binding ActualWidth,ElementName=CanvasRoot}" Height="{Binding ActualHeight,ElementName=CanvasRoot}" Data="{TemplateBinding Icon}" Fill="{TemplateBinding Background}" Stretch="Uniform"/>
|
||||
<Border x:Name="PART_Icon" Visibility="Collapsed">
|
||||
<Path Width="{Binding ActualWidth,ElementName=CanvasRoot}" HorizontalAlignment="Left" Height="{Binding ActualHeight,ElementName=CanvasRoot}" Data="{TemplateBinding Icon}" Fill="{TemplateBinding Foreground}" Stretch="Uniform"/>
|
||||
</Border>
|
||||
</Canvas>
|
||||
<ControlTemplate.Triggers>
|
||||
<EventTrigger RoutedEvent="UIElement.MouseEnter" SourceName="CanvasRoot">
|
||||
<BeginStoryboard Storyboard="{StaticResource OnMouseEnter}"/>
|
||||
</EventTrigger>
|
||||
<EventTrigger RoutedEvent="UIElement.MouseLeave" SourceName="CanvasRoot">
|
||||
<BeginStoryboard Storyboard="{StaticResource OnMouseLeave}"/>
|
||||
</EventTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="RateHorizontalItemsPanelTemplate">
|
||||
<UniformGrid Rows="1" Margin="-5,0"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<Style x:Key="RateBaseStyle" TargetType="controls:Rate">
|
||||
<Setter Property="ItemMargin" Value="5,0"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalAlignment" Value="Top"/>
|
||||
<Setter Property="Icon" Value="{StaticResource StarGeometry}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource RateRateItemBaseStyle}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource RateHorizontalItemsPanelTemplate}"/>
|
||||
<Setter Property="Text" Value="{Binding Value,RelativeSource={RelativeSource Self},StringFormat={}{0:0.0}}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:Rate">
|
||||
<StackPanel Background="Transparent" Orientation="Horizontal" x:Name="PART_Panel">
|
||||
<ItemsPresenter/>
|
||||
<TextBlock Visibility="{TemplateBinding ShowText,Converter={StaticResource Boolean2VisibilityConverter}}" Text="{TemplateBinding Text}" Margin="10,0,0,0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,10 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Base/RateBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style BasedOn="{StaticResource RateBaseStyle}" TargetType="controls:Rate"/>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -48,6 +48,7 @@
|
||||
<ResourceDictionary Source="Tag.xaml"/>
|
||||
<ResourceDictionary Source="RadioGroup.xaml"/>
|
||||
<ResourceDictionary Source="FlipClock.xaml"/>
|
||||
<ResourceDictionary Source="Rate.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -120,5 +120,13 @@ namespace HandyControl.Tools
|
||||
/// <param name="p"></param>
|
||||
/// <returns></returns>
|
||||
public static double CalAngle(Point center, Point p) => Math.Atan2(p.Y - center.Y, p.X - center.X) * 180 / Math.PI;
|
||||
|
||||
public static bool IsValidDoubleValue(object value)
|
||||
{
|
||||
var d = (double)value;
|
||||
if (!double.IsNaN(d))
|
||||
return !double.IsInfinity(d);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Tools;
|
||||
|
||||
namespace HandyControlDemo
|
||||
{
|
||||
@@ -24,6 +26,8 @@ namespace HandyControlDemo
|
||||
{
|
||||
UpdateSkin(GlobalData.Config.Skin);
|
||||
}
|
||||
|
||||
BlurWindow.SystemVersionInfo = CommonHelper.GetSystemVersionInfo();
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
|
||||
public static readonly string BlurWindow = nameof(BlurWindow);
|
||||
|
||||
public static readonly string RateDemoCtl = nameof(RateDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
|
||||
|
||||
@@ -34,7 +34,8 @@ var controlList = new List<string>
|
||||
"OutlineTextDemoCtl",
|
||||
"FlipClockDemoCtl",
|
||||
"QQGroupView",
|
||||
"BlurWindow"
|
||||
"BlurWindow",
|
||||
"RateDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.4.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -96,6 +97,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Service\DataService.cs" />
|
||||
<Compile Include="Tools\AssemblyHelper.cs" />
|
||||
<Compile Include="Tools\CommonHelper.cs" />
|
||||
<Compile Include="Tools\Converter\StringRepeatConverter.cs" />
|
||||
<Compile Include="UserControl\Basic\Avatar.xaml.cs">
|
||||
<DependentUpon>Avatar.xaml</DependentUpon>
|
||||
@@ -160,6 +162,9 @@
|
||||
<Compile Include="UserControl\Controls\PreviewSliderDemoCtl.xaml.cs">
|
||||
<DependentUpon>PreviewSliderDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Controls\RateDemoCtl.xaml.cs">
|
||||
<DependentUpon>RateDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Controls\ScrollViewerDemoCtl.xaml.cs">
|
||||
<DependentUpon>ScrollViewerDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -438,6 +443,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Controls\RateDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Controls\ScrollViewerDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -638,6 +647,7 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="Resources\Img\LeftMainContent\Star.png" />
|
||||
<Resource Include="Resources\Img\qq-group.jpg" />
|
||||
<Resource Include="Resources\Img\LeftMainContent\FlipVertical_16x.png" />
|
||||
<Resource Include="Resources\Img\car_chase.gif" />
|
||||
|
||||
@@ -744,6 +744,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 评分 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Rate {
|
||||
get {
|
||||
return ResourceManager.GetString("Rate", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 注册 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -444,4 +444,7 @@
|
||||
<data name="OpenBlurWindow" xml:space="preserve">
|
||||
<value>open blur window</value>
|
||||
</data>
|
||||
<data name="Rate" xml:space="preserve">
|
||||
<value>Rate</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -424,4 +424,7 @@
|
||||
<data name="OpenBlurWindow" xml:space="preserve">
|
||||
<value>点击打开背景模糊窗口</value>
|
||||
</data>
|
||||
<data name="Rate" xml:space="preserve">
|
||||
<value>评分</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -9,6 +9,7 @@
|
||||
<Geometry x:Key="NugetGeometry">M449.722947 199.412211H706.021053c130.967579 0 237.136842 106.169263 237.136842 237.136842v256.298105c0 130.967579-106.169263 237.136842-237.136842 237.136842H449.722947c-130.965895 0-237.136842-106.169263-237.136842-237.136842V436.549053c0-130.967579 106.170947-237.136842 237.136842-237.136842z m-201.205894-21.557895c0-64.299789-70.085053-104.704-125.850948-72.55579s-55.764211 112.96 0 145.111579 125.850947-8.257684 125.850948-72.555789z m239.528421 234.74021c0-68.003368-74.088421-110.736842-133.037474-76.734315s-58.950737 119.467789 0 153.470315 133.039158-8.730947 133.039158-76.736zM835.368421 692.847158c0-117.596632-128.154947-191.494737-230.123789-132.695579s-101.970526 206.593684 0 265.391158S835.368421 810.443789 835.368421 692.847158z</Geometry>
|
||||
<Geometry x:Key="EmailGeometry">M430.079734 481.464543c45.196365 45.596478 118.486578 45.596478 163.68499 0l360.684736-324.939627c0.547469 3.751441 1.13894 7.490601 1.13894 11.401678l0 404.753417 0 116.754121c0 42.995233-34.547841 77.838809-77.145008 77.838809L145.397996 767.272941c-42.597167 0-77.145008-34.844599-77.145008-77.838809L68.252988 494.839155 68.252988 167.926594c0-3.911076 0.593518-7.65126 1.139963-11.401678L430.079734 481.464543zM910.960992 74.226538 562.044278 387.28558c-38.470173 38.811957-62.276369 38.811957-100.770078 0L112.538611 74.408687c10.011005-4.789073 21.069875-7.673773 32.859385-7.673773l733.044372 0C890.095779 66.735937 901.065622 69.539796 910.960992 74.226538z</Geometry>
|
||||
<Geometry x:Key="GitterGeometry">M260.8 645H160V0h100.8v645zM461.8 152.2h-100.8V1024h100.8V152.2z m201.2 0h-100.8V1024h100.8V152.2zM864 152h-100.8v494H864V152z</Geometry>
|
||||
<Geometry x:Key="LoveGeometry">M890.2 208.2c-91.8-91.9-242.1-91.9-334 0L544.4 220c-18.2 18.2-47.6 18.2-65.8 0l-11.8-11.8c-91.9-91.9-242.1-91.9-334 0C41 300 24.7 533.9 203.6 722.1 304 827.8 412.4 882.3 470 905.9c26.6 10.9 56.5 10.9 83 0 57.6-23.6 166-78.1 266.4-183.8 178.9-188.2 162.6-422 70.8-513.9z</Geometry>
|
||||
<Geometry x:Key="CnblogsGeometry">M512 0C229.234472 0 0 229.226146 0 512 0 794.765528 229.234472 1024 512 1024S1024 794.765528 1024 512C1024 229.226146 794.765528 0 512 0zM228.776585 836.066862c-63.163317 0-114.371642-51.208325-114.371642-114.371642S165.613268 607.323577 228.776585 607.323577s114.371642 51.208325 114.371643 114.371643c0 63.171642-51.208325 114.371642-114.371643 114.371642z m420.555968-89.612488a391.867317 391.867317 0 0 1-1.989724 16.975089c-7.259577 30.203837-33.950179 52.898341-66.376845 52.898342-38.104455 0-68.990959-34.158309-68.99096-72.204488 0-5.877593 0.81587-11.463805 2.206179-16.775284-1.756618-131.096976-103.981789-237.867707-233.205593-246.883903l-6.343805-0.740943-1.015675-0.041626c-5.453008-0.216455-10.930992-0.732618-16.142569-2.331057a67.958634 67.958634 0 0 1-47.91987-65.078114c0-37.604943 30.245463-68.091837 67.550699-68.091837 0.299707 0 0.591089 0.041626 0.890797 0.049951l0.124878-0.049951c205.707447 2.139577 371.836878 169.484488 371.836878 375.699772 0 7.717463-0.341333 15.34335-0.824195 22.94426 0.066602 1.207154 0.19148 2.397659 0.199805 3.629789z m254.085203-63.329821c-10.856065 45.172553-25.80813 104.114992-74.310764 104.114992-56.994341 0-48.236228-66.085463-48.236228-122.996553 0-8.791415 1.223805-17.149919 3.296781-25.100488-2.639089-196.108488-169.834146-387.812943-363.137041-401.291447l-35.806699-5.827642c-42.117203-7.492683-111.715902-3.255154-111.715903-49.193626 0-56.253398 50.234276-81.861724 106.038114-81.861724 0.449561 0 0.882472 0.058276 1.332033 0.066602l0.183154-0.066602c307.724488 3.180228 526.252748 208.546341 526.252748 517.028423a538.474146 538.474146 0 0 1-1.23213 34.316488c0.108228 1.806569 0.291382 3.596488 0.308033 5.428032a542.72 542.72 0 0 1-2.972098 25.383545z</Geometry>
|
||||
<Geometry x:Key="ConfigGeometry">M827.904 541.184a278.592 278.592 0 0 0 0-58.368l73.728-58.368c15.872-13.056 20.224-35.584 9.728-53.504l-78.592-137.728c-9.984-17.408-31.232-25.856-51.712-18.176l-86.528 35.072c-15.872-11.52-32.512-21.248-49.664-29.184l-12.8-92.928c-3.072-20.224-20.736-35.584-41.216-35.584h-157.44c-20.736 0-38.144 14.848-41.216 35.84L378.88 221.44c-17.152 7.936-33.792 17.92-49.664 29.184L242.688 215.296c-18.688-7.168-41.216 0.768-51.2 18.176L112.64 371.2c-10.24 17.92-6.144 40.448 10.24 53.76l73.472 58.112c-1.024 9.472-1.536 19.2-1.536 29.184 0 9.728 0.512 19.456 1.536 29.184l-73.984 58.368c-15.872 13.056-19.968 35.584-9.728 53.248l78.848 137.728c9.984 17.408 32 25.856 51.456 17.92l86.528-35.072c15.872 11.52 32.512 21.248 49.664 29.184l13.056 93.696c3.328 20.48 20.48 35.328 41.216 35.328h157.44c20.48 0 38.144-15.36 41.216-35.84l13.056-93.184c17.152-7.936 33.792-17.664 49.664-29.184l86.784 35.328c4.864 1.792 9.984 2.816 15.104 2.816 14.848 0 28.672-7.936 36.096-20.992l78.592-137.728c10.24-17.664 6.4-40.192-9.984-53.76l-73.472-58.112z m-25.344 231.168l-99.584-40.448c-7.424-3.072-15.872-1.792-22.272 3.072-19.712 15.36-40.704 27.648-62.464 36.608-7.424 3.072-12.544 9.728-13.568 17.664l-14.592 104.96-155.392 2.304-15.104-107.264c-1.024-7.936-6.4-14.592-13.568-17.664-21.76-8.96-42.752-21.504-62.464-36.608-4.096-3.072-8.96-4.608-13.824-4.608-2.816 0-5.888 0.512-8.448 1.536l-96.256 41.472-80.896-137.216 84.48-66.816c6.144-4.864 9.472-12.8 8.448-20.48-1.536-12.032-2.56-24.32-2.56-36.608 0-12.288 1.024-24.576 2.56-36.608 1.024-7.936-2.048-15.616-8.448-20.48l-83.712-64 76.544-139.264 99.584 40.448c7.424 3.072 15.872 1.792 22.272-3.072 19.712-15.36 40.96-27.648 62.72-36.864 7.424-3.072 12.544-9.728 13.568-17.664l12.544-104.704 157.696-2.304 15.104 107.264c1.024 7.936 6.4 14.592 13.568 17.664 21.76 8.96 42.752 21.504 62.464 36.864 6.4 4.864 14.848 6.144 22.272 3.072l96.256-41.472 80.896 137.216-84.48 66.816c-6.144 4.864-9.472 12.544-8.448 20.48 1.536 12.032 2.56 24.32 2.56 36.608 0 12.288-1.024 24.576-2.56 36.608-1.024 7.936 2.304 15.616 8.448 20.48l83.712 63.744-77.056 139.264zM512 345.6c-91.136 0-165.12 74.752-165.12 166.4s73.984 166.4 165.12 166.4 165.12-74.752 165.12-166.4-73.984-166.4-165.12-166.4z m0 297.216c-71.168 0-129.28-58.624-129.28-130.816 0-72.192 58.112-130.816 129.28-130.816s129.28 58.624 129.28 130.816c0 72.192-57.856 130.816-129.28 130.816z</Geometry>
|
||||
<Geometry x:Key="ContributorsGeometry">M657.486769 287.744c5.671385 0 11.264-5.671385 16.935385-5.671385l186.289231-124.140307c5.592615-5.592615 16.935385-16.935385 16.935384-28.199385V73.334154A74.673231 74.673231 0 0 0 804.233846 0H606.680615v220.002462c0 22.606769-16.935385 33.870769-39.463384 33.870769H454.262154c-22.528 0-39.463385-16.935385-39.463385-33.870769V5.671385H222.838154c-45.134769 0-79.005538 33.870769-79.005539 73.255384v56.477539c0 11.264 5.671385 22.528 16.935385 28.199384l186.289231 124.140308h16.935384C200.310154 349.735385 98.697846 507.746462 121.304615 693.878154c22.528 169.275077 169.353846 310.350769 344.221539 327.207384 237.095385 28.199385 440.32-152.339692 440.32-377.934769 0-158.011077-101.612308-299.008-248.359385-355.406769z m-146.747077 671.271385C335.793231 959.015385 189.046154 818.018462 189.046154 643.150769c0-174.867692 146.747077-310.350769 321.693538-310.350769 174.946462 0 321.693538 141.075692 321.693539 315.943385s-146.747077 310.350769-321.693539 310.350769zM670.798769 572.967385l-68.371692-11.185231a31.507692 31.507692 0 0 1-28.514462-16.777846l-28.514461-55.926154c-17.092923-27.963077-51.278769-27.963077-68.371692 0l-28.514462 55.926154a31.507692 31.507692 0 0 1-28.514462 16.777846l-68.371692 11.185231c-28.514462 5.592615-39.936 39.148308-17.092923 61.44l45.528615 39.227077c5.750154 11.185231 17.171692 22.370462 11.421539 33.555692l-11.421539 67.111384c-5.671385 27.963077 28.514462 50.333538 51.357539 33.555693l62.700308-27.963077a37.021538 37.021538 0 0 1 34.185846 0l62.700307 33.555692c28.514462 16.777846 57.028923-5.592615 51.27877-33.555692l-11.421539-67.111385c0-16.777846 5.750154-27.963077 11.421539-33.555692l51.278769-44.740923a38.596923 38.596923 0 0 0-22.843077-61.518769z</Geometry>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Management;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Tools
|
||||
namespace HandyControlDemo.Tools
|
||||
{
|
||||
public class CommonHelper
|
||||
{
|
||||
@@ -0,0 +1,14 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.RateDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<controls:TransitioningContentControl>
|
||||
<StackPanel Margin="32" HorizontalAlignment="Center" VerticalAlignment="Center" Width="170">
|
||||
<controls:Rate Value="2"/>
|
||||
<controls:Rate DefaultValue="3" AllowHalf="True" Margin="0,16,0,0" Foreground="{DynamicResource WarningBrush}"/>
|
||||
<controls:Rate DefaultValue="1" AllowClear="False" AllowHalf="True" Margin="0,16,0,0" Foreground="{DynamicResource DangerBrush}" Icon="{StaticResource LoveGeometry}"/>
|
||||
<controls:Rate Value="4.5" AllowHalf="True" ShowText="True" Margin="0,16,0,0" Foreground="{DynamicResource DangerBrush}" Icon="{StaticResource LoveGeometry}"/>
|
||||
</StackPanel>
|
||||
</controls:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class RateDemoCtl
|
||||
{
|
||||
public RateDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ListView_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.GroupBoxDemoCtl}" Content="{x:Static langs:Lang.GroupBox}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.GroupBoxDemoCtl}" Content="{x:Static langs:Lang.GroupBox}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/GroupBox_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
@@ -195,6 +195,11 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/FlipVertical_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.RateDemoCtl}" Content="{x:Static langs:Lang.Rate}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Star.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.SearchBarDemoCtl}" Content="{x:Static langs:Lang.SearchBar}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Search_16x.png"/>
|
||||
@@ -290,7 +295,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/WindowsForm_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
|
||||
## Latest examples
|
||||
|
||||
### Rate
|
||||
|
||||

|
||||
|
||||
### BlurWindow
|
||||
|
||||

|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Reference in new issue
Block a user