Merge pull request #48 from HandyOrg/master

Merge branch
This commit is contained in:
NaBian 2019-03-12 00:54:17 +08:00 committed by GitHub
commit 0e4658e920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
153 changed files with 2777 additions and 506 deletions

View File

@ -1,4 +1,8 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using HandyControl.Data;
using HandyControl.Tools.Converter;
namespace HandyControl.Controls
{
@ -10,5 +14,37 @@ namespace HandyControl.Controls
public static void SetCornerRadius(DependencyObject element, CornerRadius value) => element.SetValue(CornerRadiusProperty, value);
public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius)element.GetValue(CornerRadiusProperty);
public static readonly DependencyProperty CircularProperty = DependencyProperty.RegisterAttached(
"Circular", typeof(bool), typeof(BorderElement), new PropertyMetadata(ValueBoxes.FalseBox, OnCircularChanged));
private static void OnCircularChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is Border border)
{
if ((bool)e.NewValue)
{
var binding = new MultiBinding
{
Converter = new BorderCircularConverter()
};
binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) {Source = border});
binding.Bindings.Add(new Binding(FrameworkElement.ActualHeightProperty.Name) { Source = border });
border.SetBinding(Border.CornerRadiusProperty, binding);
}
else
{
BindingOperations.ClearBinding(border, FrameworkElement.MinWidthProperty);
BindingOperations.ClearBinding(border, FrameworkElement.MinHeightProperty);
BindingOperations.ClearBinding(border, Border.CornerRadiusProperty);
}
}
}
public static void SetCircular(DependencyObject element, bool value)
=> element.SetValue(CircularProperty, value);
public static bool GetCircular(DependencyObject element)
=> (bool) element.GetValue(CircularProperty);
}
}

View File

@ -14,7 +14,7 @@ namespace HandyControl.Controls
{
if (d is UIElement element)
{
CreateTrriger(element, (string) e.NewValue);
CreateTrigger(element, (string) e.NewValue);
}
}
@ -27,7 +27,7 @@ namespace HandyControl.Controls
private static CommandBinding GetCommandBinding(DependencyObject element)
=> (CommandBinding) element.GetValue(CommandBindingProperty);
private static void CreateTrriger(UIElement element, string link)
private static void CreateTrigger(UIElement element, string link)
{
element.CommandBindings.Remove(GetCommandBinding(element));
element.SetCurrentValue(CommandBindingProperty, DependencyProperty.UnsetValue);

View File

@ -12,6 +12,6 @@ namespace HandyControl.Controls
=> element.SetValue(HighlightBrushProperty, value);
public static Brush GetHighlightBrush(DependencyObject element)
=> (Brush) element.GetValue(HighlightBrushProperty);
=> (Brush) element.GetValue(HighlightBrushProperty);
}
}

View File

@ -0,0 +1,7 @@
namespace HandyControl.Controls
{
public interface IGravatarGenerator
{
object GetGravatar(string id);
}
}

View File

@ -47,6 +47,7 @@ namespace HandyControl.Controls
_textBox = GetTemplateChild(ElementTextBox) as WatermarkTextBox;
if (_textBox != null)
{
_textBox.Text = Text;
SetBinding(TextProperty, new Binding(TextProperty.Name)
{
Source = _textBox,
@ -191,4 +192,4 @@ namespace HandyControl.Controls
return result.Data;
}
}
}
}

View File

@ -5,6 +5,8 @@ using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using HandyControl.Data;
using HandyControl.Expression.Drawing;
using HandyControl.Tools.Extension;
namespace HandyControl.Controls
{
@ -17,6 +19,11 @@ namespace HandyControl.Controls
/// </summary>
private Storyboard _storyboard;
/// <summary>
/// 路径长度
/// </summary>
private double _pathLength;
/// <summary>
/// 路径
/// </summary>
@ -47,8 +54,7 @@ namespace HandyControl.Controls
/// 路径长度
/// </summary>
public static readonly DependencyProperty PathLengthProperty = DependencyProperty.Register(
"PathLength", typeof(double), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
OnPropertiesChanged));
"PathLength", typeof(double), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, OnPropertiesChanged));
/// <summary>
/// 路径长度
@ -146,34 +152,47 @@ namespace HandyControl.Controls
remove => RemoveHandler(CompletedEvent, value);
}
/// <summary>
/// 更新路径
/// </summary>
private void UpdatePath()
{
if (!Duration.HasTimeSpan || !IsPlaying) return;
StrokeDashOffset = PathLength;
_pathLength = PathLength > 0 ? PathLength : Data.GetTotalLength(new Size(ActualWidth, ActualHeight), StrokeThickness);
if (MathHelper.IsVerySmall(_pathLength)) return;
StrokeDashOffset = _pathLength;
StrokeDashArray = new DoubleCollection(new List<double>
{
PathLength,
PathLength
_pathLength,
_pathLength
});
//定义动画
if (_storyboard != null)
{
_storyboard.Stop();
_storyboard.Completed -= Storyboard_Completed;
}
_storyboard = new Storyboard
{
RepeatBehavior = RepeatBehavior
};
_storyboard.Completed += (s, e) => RaiseEvent(new RoutedEventArgs(CompletedEvent));
_storyboard.Completed += Storyboard_Completed;
var frames = new DoubleAnimationUsingKeyFrames();
//开始位置
var frame0 = new LinearDoubleKeyFrame
{
Value = PathLength,
Value = _pathLength,
KeyTime = KeyTime.FromTimeSpan(TimeSpan.Zero)
};
//结束位置
var frame1 = new LinearDoubleKeyFrame
{
Value = -PathLength,
Value = -_pathLength,
KeyTime = KeyTime.FromTimeSpan(Duration.TimeSpan)
};
frames.KeyFrames.Add(frame0);
@ -185,5 +204,7 @@ namespace HandyControl.Controls
_storyboard.Begin();
}
private void Storyboard_Completed(object sender, EventArgs e) => RaiseEvent(new RoutedEventArgs(CompletedEvent));
}
}

View File

@ -0,0 +1,64 @@
using System.Windows;
using System.Windows.Controls;
using HandyControl.Data;
namespace HandyControl.Controls
{
/// <summary>
/// 标记
/// </summary>
public class Badge : ContentControl
{
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(Badge), new PropertyMetadata(default(string)));
public string Text
{
get => (string) GetValue(TextProperty);
set => SetValue(TextProperty, value);
}
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value", typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int0Box, OnValueChanged));
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (Badge) d;
var v = (int) e.NewValue;
ctl.Text = v <= ctl.Maximum ? v.ToString() : $"{ctl.Maximum}+";
}
public int Value
{
get => (int) GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
public static readonly DependencyProperty IsDotProperty = DependencyProperty.Register(
"IsDot", typeof(bool), typeof(Badge), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsDot
{
get => (bool) GetValue(IsDotProperty);
set => SetValue(IsDotProperty, value);
}
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
"Maximum", typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int99Box, OnValueChanged));
public int Maximum
{
get => (int) GetValue(MaximumProperty);
set => SetValue(MaximumProperty, value);
}
public static readonly DependencyProperty BadgeMarginProperty = DependencyProperty.Register(
"BadgeMargin", typeof(Thickness), typeof(Badge), new PropertyMetadata(default(Thickness)));
public Thickness BadgeMargin
{
get => (Thickness) GetValue(BadgeMarginProperty);
set => SetValue(BadgeMarginProperty, value);
}
}
}

View File

@ -0,0 +1,69 @@
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using HandyControl.Interactivity;
using HandyControl.Tools;
namespace HandyControl.Controls
{
public class Dialog : ContentControl
{
private Adorner _container;
public Dialog()
{
CommandBindings.Add(new CommandBinding(ControlCommands.Close, (s, e) => Close()));
}
public static Dialog Show(object content)
{
var dialog = new Dialog
{
Content = content
};
var window = VisualHelper.GetActiveWindow();
if (window != null)
{
var decorator = VisualHelper.GetChild<AdornerDecorator>(window);
if (decorator != null)
{
if (decorator.Child != null)
{
decorator.Child.IsEnabled = false;
}
var layer = decorator.AdornerLayer;
if (layer != null)
{
var container = new AdornerContainer(layer)
{
Child = dialog
};
dialog._container = container;
layer.Add(container);
}
}
}
return dialog;
}
public void Close()
{
var window = VisualHelper.GetActiveWindow();
if (window != null)
{
var decorator = VisualHelper.GetChild<AdornerDecorator>(window);
if (decorator != null)
{
if (decorator.Child != null)
{
decorator.Child.IsEnabled = true;
}
var layer = decorator.AdornerLayer;
layer?.Remove(_container);
}
}
}
}
}

View File

@ -30,7 +30,7 @@ namespace HandyControl.Controls
{
_scrollViewer.ScrollChanged -= ScrollViewer_ScrollChanged;
}
_scrollViewer = VisualHelper.GetGetChild<System.Windows.Controls.ScrollViewer>(obj);
_scrollViewer = VisualHelper.GetChild<System.Windows.Controls.ScrollViewer>(obj);
if (_scrollViewer != null)
{
_scrollViewer.ScrollChanged += ScrollViewer_ScrollChanged;

View File

@ -0,0 +1,51 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using HandyControl.Tools;
namespace HandyControl.Controls
{
public class Gravatar : ContentControl
{
public static readonly DependencyProperty GeneratorProperty = DependencyProperty.Register(
"Generator", typeof(IGravatarGenerator), typeof(Gravatar), new PropertyMetadata(new GithubGravatarGenerator()));
public IGravatarGenerator Generator
{
get => (IGravatarGenerator) GetValue(GeneratorProperty);
set => SetValue(GeneratorProperty, value);
}
public static readonly DependencyProperty IdProperty = DependencyProperty.Register(
"Id", typeof(string), typeof(Gravatar), new PropertyMetadata(default(string), OnIdChanged));
private static void OnIdChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (Gravatar) d;
if (ctl.Source != null) return;
ctl.Content = ctl.Generator.GetGravatar((string)e.NewValue);
}
public string Id
{
get => (string) GetValue(IdProperty);
set => SetValue(IdProperty, value);
}
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(ImageSource), typeof(Gravatar), new PropertyMetadata(default(ImageSource), OnSourceChanged));
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (Gravatar)d;
ctl.Background = new ImageBrush((ImageSource)e.NewValue);
}
public ImageSource Source
{
get => (ImageSource) GetValue(SourceProperty);
set => SetValue(SourceProperty, value);
}
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace HandyControl.Controls
{
/// <summary>
/// 用以代替Grid
/// </summary>
/// <remarks>
/// 当不需要Grid的行、列分隔等功能时建议用此轻量级类代替
/// </remarks>
public class SimplePanel : Panel
{
protected override Size MeasureOverride(Size availableSize)
{
var maxSize = new Size();
var children = InternalChildren;
for (int i = 0, count = children.Count; i < count; ++i)
{
var child = children[i];
if (child != null)
{
child.Measure(availableSize);
maxSize.Width = Math.Max(maxSize.Width, child.DesiredSize.Width);
maxSize.Height = Math.Max(maxSize.Height, child.DesiredSize.Height);
}
}
return maxSize;
}
protected override Size ArrangeOverride(Size arrangeSize)
{
foreach (UIElement child in InternalChildren)
{
child?.Arrange(new Rect(arrangeSize));
}
return arrangeSize;
}
}
}

View File

@ -0,0 +1,119 @@
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using HandyControl.Data;
using HandyControl.Expression.Drawing;
namespace HandyControl.Controls
{
/// <summary>
/// 波浪进度条
/// </summary>
[TemplatePart(Name = ElementWave, Type = typeof(FrameworkElement))]
[TemplatePart(Name = ElementClip, Type = typeof(FrameworkElement))]
public class WaveProgressBar : RangeBase
{
private const string ElementWave = "PART_Wave";
private const string ElementClip = "PART_Clip";
private FrameworkElement _waveElement;
private const double TranslateTransformMinY = -20;
private double _translateTransformYRange;
private TranslateTransform _translateTransform;
public WaveProgressBar() => Loaded += (s, e) => UpdateWave(Value);
static WaveProgressBar()
{
FocusableProperty.OverrideMetadata(typeof(WaveProgressBar),
new FrameworkPropertyMetadata(ValueBoxes.FalseBox));
MaximumProperty.OverrideMetadata(typeof(WaveProgressBar),
new FrameworkPropertyMetadata(ValueBoxes.Double100Box));
}
protected override void OnValueChanged(double oldValue, double newValue)
{
base.OnValueChanged(oldValue, newValue);
UpdateWave(newValue);
}
private void UpdateWave(double value)
{
if (_translateTransform == null || MathHelper.IsVerySmall(Maximum)) return;
var scale = 1 - value / Maximum;
var y = _translateTransformYRange * scale + TranslateTransformMinY;
_translateTransform.Y = y;
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_waveElement = GetTemplateChild(ElementWave) as FrameworkElement;
var clipElement = GetTemplateChild(ElementClip) as FrameworkElement;
if (_waveElement != null && clipElement != null)
{
_translateTransform = new TranslateTransform
{
Y = clipElement.Height
};
_translateTransformYRange = clipElement.Height - TranslateTransformMinY;
_waveElement.RenderTransform = new TransformGroup
{
Children = {_translateTransform}
};
}
}
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(WaveProgressBar), 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(WaveProgressBar), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowText
{
get => (bool)GetValue(ShowTextProperty);
set => SetValue(ShowTextProperty, value);
}
public static readonly DependencyProperty WaveFillProperty = DependencyProperty.Register(
"WaveFill", typeof(Brush), typeof(WaveProgressBar), new PropertyMetadata(default(Brush)));
public Brush WaveFill
{
get => (Brush) GetValue(WaveFillProperty);
set => SetValue(WaveFillProperty, value);
}
public static readonly DependencyProperty WaveThicknessProperty = DependencyProperty.Register(
"WaveThickness", typeof(double), typeof(WaveProgressBar), new PropertyMetadata(ValueBoxes.Double0Box));
public double WaveThickness
{
get => (double) GetValue(WaveThicknessProperty);
set => SetValue(WaveThicknessProperty, value);
}
public static readonly DependencyProperty WaveStrokeProperty = DependencyProperty.Register(
"WaveStroke", typeof(Brush), typeof(WaveProgressBar), new PropertyMetadata(default(Brush)));
public Brush WaveStroke
{
get => (Brush) GetValue(WaveStrokeProperty);
set => SetValue(WaveStrokeProperty, value);
}
}
}

View File

@ -31,6 +31,8 @@
internal static object Int5Box = 5;
internal static object Int99Box = 99;
internal static object BooleanBox(bool value) => value ? TrueBox : FalseBox;
}
}

View File

@ -86,6 +86,7 @@
<Compile Include="Controls\Attach\PanelElement.cs" />
<Compile Include="Controls\Attach\VisualElement.cs" />
<Compile Include="Controls\Base\HeaderedSelectableItem.cs" />
<Compile Include="Controls\Base\IGravatarGenerator.cs" />
<Compile Include="Controls\Base\ISelectable.cs" />
<Compile Include="Controls\Base\RegularItemsControl.cs" />
<Compile Include="Controls\Base\SelectableItem.cs" />
@ -108,15 +109,20 @@
<Compile Include="Controls\Attach\TitleElement.cs" />
<Compile Include="Controls\Button\ContextMenuButton.cs" />
<Compile Include="Controls\Button\ContextMenuToggleButton.cs" />
<Compile Include="Controls\Other\Badge.cs" />
<Compile Include="Controls\Other\Carousel.cs" />
<Compile Include="Controls\Cover\CoverView\CoverView.cs" />
<Compile Include="Controls\Other\ChatBubble.cs" />
<Compile Include="Controls\Other\Dialog.cs" />
<Compile Include="Controls\Other\GotoTop.cs" />
<Compile Include="Controls\Other\Gravatar.cs" />
<Compile Include="Controls\Panel\SimplePanel.cs" />
<Compile Include="Controls\ProgressBar\WaveProgressBar.cs" />
<Compile Include="Controls\Transfer\Transfer.cs" />
<Compile Include="Controls\Transfer\TransferGroup.cs" />
<Compile Include="Controls\Transfer\TransferItem.cs" />
<Compile Include="Controls\Panel\CirclePanel.cs" />
<Compile Include="Controls\Other\CircleProgressBar.cs" />
<Compile Include="Controls\ProgressBar\CircleProgressBar.cs" />
<Compile Include="Controls\Other\RadioGroup.cs" />
<Compile Include="Controls\Other\Shield.cs" />
<Compile Include="Controls\Panel\WaterfallPanel.cs" />
@ -174,8 +180,12 @@
<Compile Include="Data\ResourceToken.cs" />
<Compile Include="Data\SystemVersionInfo.cs" />
<Compile Include="Tools\Converter\Boolean2StrConverter.cs" />
<Compile Include="Tools\Converter\BorderClipConverter.cs" />
<Compile Include="Tools\Converter\BorderCircularConverter.cs" />
<Compile Include="Tools\Converter\Int2StrConverter.cs" />
<Compile Include="Tools\Extension\EnumerableExtension.cs" />
<Compile Include="Tools\Extension\GeometryExtension.cs" />
<Compile Include="Tools\GithubGravatarGenerator.cs" />
<Compile Include="Tools\Helper\ColorHelper.cs" />
<Compile Include="Tools\GifImageAnimator.cs" />
<Compile Include="Data\GrowlInfo.cs" />
@ -356,6 +366,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Badge.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Base\BadgeBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Base\ChatBubbleBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -380,10 +398,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Base\DialogBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Base\GotoTopBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Base\GravatarBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Base\ProgressButtonBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -428,6 +454,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Dialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\FlipClock.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -436,6 +466,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Gravatar.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\GroupBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -14,8 +14,7 @@ namespace HandyControl.Interactivity
public UIElement Child
{
get =>
_child;
get => _child;
set
{
AddVisualChild(value);

View File

@ -1,95 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
@ -108,13 +89,13 @@
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Confirm" xml:space="preserve">
<value>Confirm</value>

View File

@ -15,5 +15,7 @@
<converter:Object2BooleanConverter x:Key="Object2BooleanConverter"/>
<converter:Boolean2StrConverter x:Key="Boolean2StrConverter"/>
<converter:Int2StrConverter x:Key="Int2StrConverter"/>
<converter:BorderClipConverter x:Key="BorderClipConverter"/>
<converter:BorderCircularConverter x:Key="BorderCircularConverter"/>
</ResourceDictionary>

View File

@ -0,0 +1,33 @@
<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="Base/BadgeBaseStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource BadgeBaseStyle}" TargetType="controls:Badge">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
</Style>
<Style x:Key="BadgePrimary" BasedOn="{StaticResource BadgeBaseStyle}" TargetType="controls:Badge">
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
</Style>
<Style x:Key="BadgeSuccess" BasedOn="{StaticResource BadgeBaseStyle}" TargetType="controls:Badge">
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
</Style>
<Style x:Key="BadgeInfo" BasedOn="{StaticResource BadgeBaseStyle}" TargetType="controls:Badge">
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
</Style>
<Style x:Key="BadgeWarning" BasedOn="{StaticResource BadgeBaseStyle}" TargetType="controls:Badge">
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
</Style>
<Style x:Key="BadgeDanger" BasedOn="{StaticResource BadgeBaseStyle}" TargetType="controls:Badge">
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
</Style>
</ResourceDictionary>

View File

@ -0,0 +1,44 @@
<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="../Border.xaml"/>
</ResourceDictionary.MergedDictionaries>
<ControlTemplate x:Key="BadgeTextTemplate" TargetType="controls:Badge">
<controls:SimplePanel>
<ContentPresenter/>
<Border Style="{StaticResource BorderCircular}" Margin="{TemplateBinding BadgeMargin}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter ContentSource="Text" Margin="{TemplateBinding Padding}"/>
</Border>
</controls:SimplePanel>
</ControlTemplate>
<ControlTemplate x:Key="BadgeDotTemplate" TargetType="controls:Badge">
<controls:SimplePanel>
<ContentPresenter/>
<Border Margin="{TemplateBinding BadgeMargin}" Width="10" Height="10" CornerRadius="5" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
</controls:SimplePanel>
</ControlTemplate>
<Style x:Key="BadgeBaseStyle" TargetType="controls:Badge">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource RegionBrush}"/>
<Setter Property="Padding" Value="6,2"/>
<Setter Property="Template" Value="{StaticResource BadgeTextTemplate}"/>
<Setter Property="HorizontalContentAlignment" Value="Right"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="BadgeMargin" Value="0,-10,-10,0"/>
<Style.Triggers>
<Trigger Property="IsDot" Value="True">
<Setter Property="Template" Value="{StaticResource BadgeDotTemplate}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="BadgeMargin" Value="0,-5,-5,0"/>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

View File

@ -0,0 +1,19 @@
<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">
<Style x:Key="DialogBaseStyle" TargetType="controls:Dialog">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Dialog">
<Border Background="{DynamicResource DarkOpacityBrush}">
<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -0,0 +1,22 @@
<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">
<Style x:Key="GravatarBaseStyle" TargetType="controls:Gravatar">
<Setter Property="Width" Value="72"/>
<Setter Property="Height" Value="72"/>
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
<Setter Property="Padding" Value="6"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Gravatar">
<Border ClipToBounds="True" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter Margin="{TemplateBinding Padding}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -5,6 +5,7 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Basic/Converters.xaml"/>
<ResourceDictionary Source="../Border.xaml"/>
</ResourceDictionary.MergedDictionaries>
<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill" StartPoint="0,0" EndPoint="1,0">
@ -70,13 +71,12 @@
</Style>
<Style x:Key="ProgressBarCircleBaseStyle" TargetType="controls:CircleProgressBar">
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="Height" Value="100"/>
<Setter Property="Width" Value="100"/>
<Setter Property="ArcThickness" Value="4"/>
<Setter Property="Text" Value="{Binding Value,RelativeSource={RelativeSource Self},StringFormat={}{0} %}"/>
<Setter Property="Text" Value="{Binding Value,RelativeSource={RelativeSource Self},StringFormat={}{0:F0} %}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:CircleProgressBar">
@ -90,4 +90,51 @@
</Setter>
</Style>
<Style x:Key="ProgressBarWaveBaseStyle" TargetType="controls:WaveProgressBar">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
<Setter Property="Width" Value="100"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="Text" Value="{Binding Value,RelativeSource={RelativeSource Self},StringFormat={}{0:F0} %}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:WaveProgressBar">
<ControlTemplate.Resources>
<Storyboard x:Key="StoryboardOnLoaded" RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)" Storyboard.TargetName="PART_Wave">
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-400"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<StackPanel>
<Border Style="{StaticResource BorderCircular}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<Viewbox>
<Border x:Name="PART_Clip" Style="{StaticResource BorderClip}" CornerRadius="100" Width="200" Height="200">
<Path x:Name="PART_Wave" Stroke="{TemplateBinding WaveStroke}" StrokeThickness="{TemplateBinding WaveThickness}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="250" Fill="{TemplateBinding WaveFill}" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" Margin="0,0,-400,-20">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="0,1">
<PolyBezierSegment Points="0.5,1 0.5,0 1,0"/>
<PolyBezierSegment Points="1.5,0 1.5,1 2,1"/>
<PolyBezierSegment Points="2.5,1 2.5,0 3,0"/>
<PolyLineSegment Points="3,0 3,10, 0,10 0,1"/>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
</Border>
</Viewbox>
</Border>
<TextBlock Margin="0,10,0,0" Visibility="{Binding ShowText,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Text}"/>
</StackPanel>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource StoryboardOnLoaded}"/>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -1,6 +1,11 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Basic/Converters.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!--用于包裹一个区域-->
<Style x:Key="BorderRegionStyle" TargetType="Border">
<Setter Property="Padding" Value="10"/>
@ -21,4 +26,20 @@
<Setter Property="Background" Value="{DynamicResource ThirdlyTextBrush}"/>
</Style>
<Style x:Key="BorderCircular" TargetType="Border">
<Setter Property="controls:BorderElement.Circular" Value="True"/>
</Style>
<Style x:Key="BorderClip" BasedOn="{StaticResource BorderCircular}" TargetType="Border">
<Setter Property="Clip">
<Setter.Value>
<MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/>
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -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/DialogBaseStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource DialogBaseStyle}" TargetType="controls:Dialog"/>
</ResourceDictionary>

View File

@ -0,0 +1,29 @@
<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="Base/GravatarBaseStyle.xaml"/>
<ResourceDictionary Source="Border.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource GravatarBaseStyle}" TargetType="controls:Gravatar"/>
<Style x:Key="GravatarCircle" BasedOn="{StaticResource GravatarBaseStyle}" TargetType="controls:Gravatar">
<Setter Property="Padding" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Gravatar">
<Border Style="{StaticResource BorderClip}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter Margin="{TemplateBinding Padding}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="GravatarCircleImg" BasedOn="{StaticResource GravatarCircle}" TargetType="controls:Gravatar">
<Setter Property="Padding" Value="0"/>
</Style>
</ResourceDictionary>

View File

@ -196,6 +196,26 @@
<Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
</Style>
<Style BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
<Setter Property="WaveFill" Value="{DynamicResource DarkPrimaryBrush}"/>
</Style>
<Style x:Key="ProgressBarSuccessWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
<Setter Property="WaveFill" Value="{DynamicResource DarkSuccessBrush}"/>
</Style>
<Style x:Key="ProgressBarInfoWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
<Setter Property="WaveFill" Value="{DynamicResource DarkInfoBrush}"/>
</Style>
<Style x:Key="ProgressBarWarningWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
<Setter Property="WaveFill" Value="{DynamicResource DarkWarningBrush}"/>
</Style>
<Style x:Key="ProgressBarDangerWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
<Setter Property="WaveFill" Value="{DynamicResource DarkDangerBrush}"/>
</Style>
<Style x:Key="ProgressBarFlat" TargetType="ProgressBar">
<Setter Property="Height" Value="4"/>
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>

View File

@ -58,6 +58,9 @@
<ResourceDictionary Source="Transfer.xaml"/>
<ResourceDictionary Source="ChatBubble.xaml"/>
<ResourceDictionary Source="GotoTop.xaml"/>
<ResourceDictionary Source="Gravatar.xaml"/>
<ResourceDictionary Source="Badge.xaml"/>
<ResourceDictionary Source="Dialog.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@ -96,7 +96,9 @@
<ContentPresenter WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
</Grid>
</Grid>
<ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}"/>
<AdornerDecorator Grid.Row="1">
<ContentPresenter/>
</AdornerDecorator>
<ResizeGrip Width="10" Height="10" x:Name="ResizeGrip" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="1" IsTabStop="False" Visibility="Collapsed" WindowChrome.ResizeGripDirection="BottomRight" />
</Grid>
</Border>

View File

@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace HandyControl.Tools.Converter
{
public class BorderCircularConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length == 2 && values[0] is double width && values[1] is double height)
{
if (width < double.Epsilon || height < double.Epsilon)
{
return new CornerRadius();
}
var min = Math.Min(width, height);
return new CornerRadius(min/2);
}
return DependencyProperty.UnsetValue;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}

View File

@ -0,0 +1,36 @@
//referenced from https://stackoverflow.com/a/5650367/9639378
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace HandyControl.Tools.Converter
{
public class BorderClipConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length == 3 && values[0] is double width && values[1] is double height && values[2] is CornerRadius radius)
{
if (width < double.Epsilon || height < double.Epsilon)
{
return Geometry.Empty;
}
var clip = new RectangleGeometry(new Rect(0, 0, width, height), radius.TopLeft, radius.TopLeft);
clip.Freeze();
return clip;
}
return DependencyProperty.UnsetValue;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}

View File

@ -0,0 +1,50 @@
using System;
using System.Windows;
using System.Windows.Media;
using HandyControl.Expression.Drawing;
namespace HandyControl.Tools.Extension
{
public static class GeometryExtension
{
/// <summary>
/// 获取路径总长度
/// </summary>
/// <param name="geometry"></param>
/// <returns></returns>
public static double GetTotalLength(this Geometry geometry)
{
if (geometry == null) return 0;
var pathGeometry = PathGeometry.CreateFromGeometry(geometry);
pathGeometry.GetPointAtFractionLength(1e-4, out var point, out _);
var length = (pathGeometry.Figures[0].StartPoint - point).Length * 1e+4;
return length;
}
/// <summary>
/// 获取路径总长度
/// </summary>
/// <param name="geometry"></param>
/// <param name="size"></param>
/// <param name="strokeThickness"></param>
/// <returns></returns>
public static double GetTotalLength(this Geometry geometry, Size size, double strokeThickness = 1)
{
if (geometry == null) return 0;
if (MathHelper.IsVerySmall(size.Width) || MathHelper.IsVerySmall(size.Height)) return 0;
var length = GetTotalLength(geometry);
var sw = geometry.Bounds.Width / size.Width;
var sh = geometry.Bounds.Height / size.Height;
var min = Math.Min(sw, sh);
if (MathHelper.IsVerySmall(min) || MathHelper.IsVerySmall(strokeThickness)) return 0;
length /= min;
return length / strokeThickness;
}
}
}

View File

@ -0,0 +1,119 @@
using System;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
using HandyControl.Controls;
namespace HandyControl.Tools
{
public class GithubGravatarGenerator : IGravatarGenerator
{
private const int RenderDataMaxLength = 15;
public object GetGravatar(string id)
{
var hashcode = GetHashCode(id);
var renderData = GetRenderData(hashcode);
var renderBrush = GetRenderBrush(hashcode);
var geometryGroup = new GeometryGroup();
void AddRec(int i, int j, bool hidden = false)
{
var rec = new RectangleGeometry(new Rect(new Point(i, j), hidden ? new Size() : new Size(1, 1)));
geometryGroup.Children.Add(rec);
}
var index = 0;
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 5; j++, index++)
{
AddRec(i, j, renderData[index] == 0);
}
}
for (int j = 0; j < 5; j++, index++)
{
AddRec(2, j, renderData[index] == 0);
}
index -= 10;
for (int i = 3; i < 5; i++)
{
for (int j = 0; j < 5; j++, index++)
{
AddRec(i, j, renderData[index] == 0);
}
index -= 10;
}
var path = new Path
{
Data = geometryGroup,
Fill = renderBrush,
VerticalAlignment = VerticalAlignment.Top
};
RenderOptions.SetEdgeMode(path, EdgeMode.Aliased);
return path;
}
private string GetHashCode(string id)
{
var md5 = MD5.Create();
var bytes = Encoding.ASCII.GetBytes(id);
var hash = md5.ComputeHash(bytes);
var stringBuilder = new StringBuilder();
foreach (var item in hash)
{
stringBuilder.Append(item.ToString("X2"));
}
return stringBuilder.ToString();
}
private int[] GetRenderData(string hashcode)
{
var arr = new int[RenderDataMaxLength];
for (int i = 0; i < RenderDataMaxLength; i++)
{
var c = hashcode[i];
var v = (int) c;
arr[i] = v % 2;
}
return arr;
}
private Brush GetRenderBrush(string hashcode)
{
var v = (double)int.Parse(hashcode.Substring(hashcode.Length - 7), NumberStyles.HexNumber);
var scale = v / 0xfffffff;
var color = Hsl2Rgb(scale);
return new SolidColorBrush(color);
}
//adapted from https://github.com/stewartlord/identicon.js/blob/4fad7cafec1b7a4d896015e084e861625ef5d64f/identicon.js#L110
private Color Hsl2Rgb(double h, double s = 0.7, double b = 0.5)
{
h *= 6;
var arr = new[]
{
b += s *= b < .5 ? b : 1 - b,
b - h % 1 * s * 2,
b -= s *= 2,
b,
b + h % 1 * s,
b + s
};
var hValue = (int) Math.Floor(h);
return Color.FromRgb((byte) (arr[hValue % 6] * 255), (byte) (arr[(hValue | 16) % 6] * 255),
(byte) (arr[(hValue | 8) % 6] * 255));
}
}
}

View File

@ -27,18 +27,18 @@ namespace HandyControl.Tools
: null;
}
internal static T GetGetChild<T>(DependencyObject d) where T : DependencyObject
internal static T GetChild<T>(DependencyObject d) where T : DependencyObject
{
if (d is T scrollViewer)
if (d is T t)
{
return scrollViewer;
return t;
}
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
{
var child = VisualTreeHelper.GetChild(d, i);
var result = GetGetChild<T>(child);
var result = GetChild<T>(child);
if (result != null) return result;
}

View File

@ -31,7 +31,7 @@
<ObjectDataProvider x:Key="DemoTypes" MethodName="GetValues" ObjectType="sys:Enum">
<ObjectDataProvider.MethodParameters>
<x:Type Type="data:DemoType"></x:Type>
<x:Type Type="data:DemoType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>

View File

@ -36,7 +36,7 @@
public static readonly string PreviewSliderDemoCtl = nameof(PreviewSliderDemoCtl);
public static readonly string CircleProgressBarDemoCtl = nameof(CircleProgressBarDemoCtl);
public static readonly string ProgressBarDemoCtl = nameof(ProgressBarDemoCtl);
public static readonly string TextBoxDemoCtl = nameof(TextBoxDemoCtl);
@ -84,29 +84,35 @@
public static readonly string GotoTopDemoCtl = nameof(GotoTopDemoCtl);
public static readonly string BadgeDemoCtl = nameof(BadgeDemoCtl);
public static readonly string GravatarDemoCtl = nameof(GravatarDemoCtl);
public static readonly string DialogDemoCtl = nameof(DialogDemoCtl);
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
public static readonly string ExpanderDemoCtl = nameof(ExpanderDemoCtl);
public static readonly string ProgressBarDemoCtl = nameof(ProgressBarDemoCtl);
public static readonly string NativeProgressBarDemoCtl = nameof(NativeProgressBarDemoCtl);
public static readonly string TabControlDemoCtl = nameof(TabControlDemoCtl);
public static readonly string CalendarDemoCtl = nameof(CalendarDemoCtl);
public static readonly string NaiveDatePickerDemoCtl = nameof(NaiveDatePickerDemoCtl);
public static readonly string NativeDatePickerDemoCtl = nameof(NativeDatePickerDemoCtl);
public static readonly string NaiveTextBoxDemoCtl = nameof(NaiveTextBoxDemoCtl);
public static readonly string NativeTextBoxDemoCtl = nameof(NativeTextBoxDemoCtl);
public static readonly string TextBlockDemoCtl = nameof(TextBlockDemoCtl);
public static readonly string NaiveComboBoxDemoCtl = nameof(NaiveComboBoxDemoCtl);
public static readonly string NativeComboBoxDemoCtl = nameof(NativeComboBoxDemoCtl);
public static readonly string NaivePasswordBoxDemoCtl = nameof(NaivePasswordBoxDemoCtl);
public static readonly string NativePasswordBoxDemoCtl = nameof(NativePasswordBoxDemoCtl);
public static readonly string NaiveTabControlDemoCtl = nameof(NaiveTabControlDemoCtl);
public static readonly string NativeTabControlDemoCtl = nameof(NativeTabControlDemoCtl);
public static readonly string DataGridDemoCtl = nameof(DataGridDemoCtl);
@ -122,7 +128,7 @@
public static readonly string RadioButtonDemoCtl = nameof(RadioButtonDemoCtl);
public static readonly string NaiveScrollViewerDemoCtl = nameof(NaiveScrollViewerDemoCtl);
public static readonly string NativeScrollViewerDemoCtl = nameof(NativeScrollViewerDemoCtl);
public static readonly string BrushDemoCtl = nameof(BrushDemoCtl);

View File

@ -21,7 +21,7 @@ var controlList = new List<string>
"WindowDemoCtl",
"ScrollViewerDemoCtl",
"PreviewSliderDemoCtl",
"CircleProgressBarDemoCtl",
"ProgressBarDemoCtl",
"TextBoxDemoCtl",
"ComboBoxDemoCtl",
"PasswordBoxDemoCtl",
@ -44,22 +44,25 @@ var controlList = new List<string>
"ProgressButtonDemoCtl",
"TransferDemoCtl",
"ChatBubbleDemoCtl",
"GotoTopDemoCtl"
"GotoTopDemoCtl",
"BadgeDemoCtl",
"GravatarDemoCtl",
"DialogDemoCtl"
};
var styleList = new List<string>
{
"ButtonDemoCtl",
"ToggleButtonDemoCtl",
"ExpanderDemoCtl",
"ProgressBarDemoCtl",
"NativeProgressBarDemoCtl",
"TabControlDemoCtl",
"CalendarDemoCtl",
"NaiveDatePickerDemoCtl",
"NaiveTextBoxDemoCtl",
"NativeDatePickerDemoCtl",
"NativeTextBoxDemoCtl",
"TextBlockDemoCtl",
"NaiveComboBoxDemoCtl",
"NaivePasswordBoxDemoCtl",
"NaiveTabControlDemoCtl",
"NativeComboBoxDemoCtl",
"NativePasswordBoxDemoCtl",
"NativeTabControlDemoCtl",
"DataGridDemoCtl",
"CheckBoxDemoCtl",
"ListBoxDemoCtl",
@ -67,7 +70,7 @@ var styleList = new List<string>
"TreeViewDemoCtl",
"BorderDemoCtl",
"RadioButtonDemoCtl",
"NaiveScrollViewerDemoCtl",
"NativeScrollViewerDemoCtl",
"BrushDemoCtl",
"SliderDemoCtl",
"GroupBoxDemoCtl",

View File

@ -130,9 +130,15 @@
<Compile Include="UserControl\Basic\ChatBox.xaml.cs">
<DependentUpon>ChatBox.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Basic\TextDialog.xaml.cs">
<DependentUpon>TextDialog.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\BadgeDemoCtl.xaml.cs">
<DependentUpon>BadgeDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\CalendarWithClockDemoCtl.xaml.cs">
<DependentUpon>CalendarWithClockDemoCtl.xaml</DependentUpon>
</Compile>
@ -145,8 +151,11 @@
<Compile Include="UserControl\Controls\CirclePanelDemoCtl.xaml.cs">
<DependentUpon>CirclePanelDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\CircleProgressBarDemoCtl.xaml.cs">
<DependentUpon>CircleProgressBarDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Controls\DialogDemoCtl.xaml.cs">
<DependentUpon>DialogDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\ProgressBarDemoCtl.xaml.cs">
<DependentUpon>ProgressBarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\ClockDemoCtl.xaml.cs">
<DependentUpon>ClockDemoCtl.xaml</DependentUpon>
@ -178,6 +187,9 @@
<Compile Include="UserControl\Controls\GotoTopDemoCtl.xaml.cs">
<DependentUpon>GotoTopDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\GravatarDemoCtl.xaml.cs">
<DependentUpon>GravatarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\OutlineTextDemoCtl.xaml.cs">
<DependentUpon>OutlineTextDemoCtl.xaml</DependentUpon>
</Compile>
@ -247,6 +259,9 @@
<Compile Include="UserControl\Main\QQGroupView.xaml.cs">
<DependentUpon>QQGroupView.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Main\UnderConstruction.xaml.cs">
<DependentUpon>UnderConstruction.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\BorderDemoCtl.xaml.cs">
<DependentUpon>BorderDemoCtl.xaml</DependentUpon>
</Compile>
@ -271,14 +286,14 @@
<Compile Include="UserControl\Styles\ListViewDemoCtl.xaml.cs">
<DependentUpon>ListViewDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveComboBoxDemoCtl.xaml.cs">
<DependentUpon>NaiveComboBoxDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeComboBoxDemoCtl.xaml.cs">
<DependentUpon>NativeComboBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\DataGridDemoCtl.xaml.cs">
<DependentUpon>DataGridDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveDatePickerDemoCtl.xaml.cs">
<DependentUpon>NaiveDatePickerDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeDatePickerDemoCtl.xaml.cs">
<DependentUpon>NativeDatePickerDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ExpanderDemoCtl.xaml.cs">
<DependentUpon>ExpanderDemoCtl.xaml</DependentUpon>
@ -301,17 +316,17 @@
<Compile Include="UserControl\Styles\MenuDemoCtl.xaml.cs">
<DependentUpon>MenuDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveScrollViewerDemoCtl.xaml.cs">
<DependentUpon>NaiveScrollViewerDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeScrollViewerDemoCtl.xaml.cs">
<DependentUpon>NativeScrollViewerDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveTabControlDemoCtl.xaml.cs">
<DependentUpon>NaiveTabControlDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeTabControlDemoCtl.xaml.cs">
<DependentUpon>NativeTabControlDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaivePasswordBoxDemoCtl.xaml.cs">
<DependentUpon>NaivePasswordBoxDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativePasswordBoxDemoCtl.xaml.cs">
<DependentUpon>NativePasswordBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ProgressBarDemoCtl.xaml.cs">
<DependentUpon>ProgressBarDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeProgressBarDemoCtl.xaml.cs">
<DependentUpon>NativeProgressBarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\TabControlDemoCtl.xaml.cs">
<DependentUpon>TabControlDemoCtl.xaml</DependentUpon>
@ -328,8 +343,8 @@
<Compile Include="UserControl\Styles\TextBlockDemoCtl.xaml.cs">
<DependentUpon>TextBlockDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveTextBoxDemoCtl.xaml.cs">
<DependentUpon>NaiveTextBoxDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeTextBoxDemoCtl.xaml.cs">
<DependentUpon>NativeTextBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ToggleButtonDemoCtl.xaml.cs">
<DependentUpon>ToggleButtonDemoCtl.xaml</DependentUpon>
@ -343,6 +358,7 @@
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
<Compile Include="ViewModel\Controls\CoverViewModel.cs" />
<Compile Include="ViewModel\Controls\DialogDemoViewModel.cs" />
<Compile Include="ViewModel\DemoViewModelBase!1.cs" />
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
@ -431,10 +447,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Basic\TextDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\AnimationPathDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\BadgeDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\CalendarWithClockDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -451,7 +475,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\CircleProgressBarDemoCtl.xaml">
<Page Include="UserControl\Controls\DialogDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\ProgressBarDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -495,6 +523,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\GravatarDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\OutlineTextDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -587,6 +619,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Main\UnderConstruction.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\BorderDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -619,7 +655,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveComboBoxDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeComboBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -627,7 +663,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveDatePickerDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeDatePickerDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -659,19 +695,19 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveScrollViewerDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeScrollViewerDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveTabControlDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeTabControlDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaivePasswordBoxDemoCtl.xaml">
<Page Include="UserControl\Styles\NativePasswordBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\ProgressBarDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeProgressBarDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -695,7 +731,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveTextBoxDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeTextBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -753,6 +789,10 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput>
</Content>
<Resource Include="Resources\Img\LeftMainContent\Dialog_16x.png" />
<Resource Include="Resources\Img\under_construction.gif" />
<Resource Include="Resources\Img\LeftMainContent\User_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\DotLarge_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\GoToTop_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Label_16x.png" />
<Resource Include="Resources\Img\Chat\chat_back1.jpg" />
@ -819,7 +859,6 @@
<Resource Include="Resources\Img\LeftMainContent\Flow_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\TimePicker_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Time_color_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\ShapeArcRing_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\NumericListBox_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Toggle_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\DataGrid_16x.png" />

View File

@ -47,7 +47,7 @@ namespace HandyControlDemo.Properties.Langs {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
@ -87,6 +87,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 标记 的本地化字符串。
/// </summary>
public static string Badge {
get {
return ResourceManager.GetString("Badge", resourceCulture);
}
}
/// <summary>
/// 查找类似 填写基本信息 的本地化字符串。
/// </summary>
@ -213,15 +222,6 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 圆形进度条 的本地化字符串。
/// </summary>
public static string CircleProgressBar {
get {
return ResourceManager.GetString("CircleProgressBar", resourceCulture);
}
}
/// <summary>
/// 查找类似 清空 的本地化字符串。
/// </summary>
@ -258,6 +258,24 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 敬请期待 的本地化字符串。
/// </summary>
public static string ComingSoon {
get {
return ResourceManager.GetString("ComingSoon", resourceCulture);
}
}
/// <summary>
/// 查找类似 评论 的本地化字符串。
/// </summary>
public static string Comment {
get {
return ResourceManager.GetString("Comment", resourceCulture);
}
}
/// <summary>
/// 查找类似 一般 的本地化字符串。
/// </summary>
@ -375,6 +393,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 对话框 的本地化字符串。
/// </summary>
public static string Dialog {
get {
return ResourceManager.GetString("Dialog", resourceCulture);
}
}
/// <summary>
/// 查找类似 在这里拖拽 的本地化字符串。
/// </summary>
@ -447,6 +474,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 头像 的本地化字符串。
/// </summary>
public static string Gravatar {
get {
return ResourceManager.GetString("Gravatar", resourceCulture);
}
}
/// <summary>
/// 查找类似 分组框 的本地化字符串。
/// </summary>
@ -762,6 +798,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 请稍后... 的本地化字符串。
/// </summary>
public static string PleaseWait {
get {
return ResourceManager.GetString("PleaseWait", resourceCulture);
}
}
/// <summary>
/// 查找类似 请输入内容 的本地化字符串。
/// </summary>
@ -888,6 +933,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 回复 的本地化字符串。
/// </summary>
public static string Reply {
get {
return ResourceManager.GetString("Reply", resourceCulture);
}
}
/// <summary>
/// 查找类似 代码仓库 的本地化字符串。
/// </summary>
@ -1068,6 +1122,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 文本对话框 的本地化字符串。
/// </summary>
public static string TextDialog {
get {
return ResourceManager.GetString("TextDialog", resourceCulture);
}
}
/// <summary>
/// 查找类似 时间条 的本地化字符串。
/// </summary>

View File

@ -387,9 +387,6 @@
<data name="Slider" xml:space="preserve">
<value>Slider</value>
</data>
<data name="CircleProgressBar" xml:space="preserve">
<value>CircleProgressBar</value>
</data>
<data name="IsNotPhone" xml:space="preserve">
<value>It's not a phone number</value>
</data>
@ -501,4 +498,28 @@
<data name="GotoTop" xml:space="preserve">
<value>GotoTop</value>
</data>
<data name="Badge" xml:space="preserve">
<value>Badge</value>
</data>
<data name="Gravatar" xml:space="preserve">
<value>Gravatar</value>
</data>
<data name="ComingSoon" xml:space="preserve">
<value>Coming Soon</value>
</data>
<data name="Comment" xml:space="preserve">
<value>Comment</value>
</data>
<data name="Reply" xml:space="preserve">
<value>Reply</value>
</data>
<data name="Dialog" xml:space="preserve">
<value>Dialog</value>
</data>
<data name="TextDialog" xml:space="preserve">
<value>TextDialog</value>
</data>
<data name="PleaseWait" xml:space="preserve">
<value>Please wait...</value>
</data>
</root>

View File

@ -387,9 +387,6 @@
<data name="Slider" xml:space="preserve">
<value>滑块</value>
</data>
<data name="CircleProgressBar" xml:space="preserve">
<value>圆形进度条</value>
</data>
<data name="IsNotPhone" xml:space="preserve">
<value>不是手机号码</value>
</data>
@ -501,4 +498,28 @@
<data name="GotoTop" xml:space="preserve">
<value>回到顶部</value>
</data>
<data name="Badge" xml:space="preserve">
<value>标记</value>
</data>
<data name="Gravatar" xml:space="preserve">
<value>头像</value>
</data>
<data name="ComingSoon" xml:space="preserve">
<value>敬请期待</value>
</data>
<data name="Comment" xml:space="preserve">
<value>评论</value>
</data>
<data name="Reply" xml:space="preserve">
<value>回复</value>
</data>
<data name="Dialog" xml:space="preserve">
<value>对话框</value>
</data>
<data name="TextDialog" xml:space="preserve">
<value>文本对话框</value>
</data>
<data name="PleaseWait" xml:space="preserve">
<value>请稍后...</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 KiB

View File

@ -36,7 +36,7 @@ namespace HandyControlDemo.Service
Name = $"Name{i}",
Type = (DemoType)i,
DataList = dataList,
ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i % 7}.png",
ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i % 6 + 1}.png",
Remark = new string(i.ToString()[0], 10)
};
list.Add(model);

View File

@ -0,0 +1,15 @@
<Border x:Class="HandyControlDemo.UserControl.TextDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
CornerRadius="10"
Width="400"
Height="247"
Background="{DynamicResource RegionBrush}">
<Grid>
<TextBlock Style="{StaticResource TextBlockLargeBold}" Text="{x:Static langs:Lang.PleaseWait}"/>
<Button Width="22" Height="22" Command="interactivity:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}" controls:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
</Grid>
</Border>

View File

@ -1,8 +1,8 @@
namespace HandyControlDemo.UserControl
{
public partial class NaiveComboBoxDemoCtl
public partial class TextDialog
{
public NaiveComboBoxDemoCtl()
public TextDialog()
{
InitializeComponent();
}

View File

@ -4,6 +4,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
<controls:TransitioningContentControl>
<controls:AnimationPath VerticalAlignment="Center" Margin="32" PathLength="400" Duration="0:0:4" Stretch="Uniform" Width="200" Height="200" StrokeThickness="2" Stroke="{DynamicResource PrimaryBrush}" Data="M40.493382,19.001303 C36.637875,19.06448 33.938568,21.421986 33.948524,25.271919 L34.068279,71.56765 34.066906,71.598007 34.068745,71.747833 34.18895,118.21758 C34.202225,123.35083 39.026951,129.19344 44.965271,131.2674 50.903587,133.34137 55.706783,130.86133 55.693504,125.72808 L55.589508,85.524513 93.866371,85.524513 93.950943,118.21758 C93.964218,123.35083 98.788948,129.19344 104.72726,131.2674 110.66558,133.34137 115.46878,130.86133 115.4555,125.72808 L115.33575,79.432381 115.33712,79.401993 115.33528,79.252007 115.21507,32.782413 C115.2018,27.64917 110.37708,21.806566 104.43876,19.732603 98.500435,17.658638 93.697243,20.138674 93.710518,25.271919 L93.814514,65.475487 55.537647,65.475487 55.453079,32.782413 C55.439804,27.64917 50.615082,21.806566 44.676762,19.732603 43.192181,19.214111 41.778549,18.980244 40.493382,19.001303 z M9.999999,0 L140,0 C145.52284,0 150,4.4771523 150,9.999999 L150,140 C150,145.52284 145.52284,150 140,150 L9.999999,150 C4.4771523,150 0,145.52284 0,140 L0,9.999999 C0,4.4771523 4.4771523,0 9.999999,0 z"/>
<Viewbox Margin="32" Width="200" Height="200">
<controls:AnimationPath VerticalAlignment="Center" Duration="0:0:6" Stretch="Uniform" Width="1024" Height="1024" StrokeThickness="10" Stroke="{DynamicResource PrimaryBrush}" Data="{StaticResource GithubGeometry}"/>
</Viewbox>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,26 @@
<UserControl x:Class="HandyControlDemo.UserControl.BadgeDemoCtl"
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"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="{DynamicResource RegionBrush}">
<controls:TransitioningContentControl>
<StackPanel Margin="32" Orientation="Horizontal">
<controls:Badge Text="New" BadgeMargin="0,-14,-20,0" Height="30">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge Text="New" BadgeMargin="0,-14,-20,0" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge Value="1" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgePrimary}">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge Value="100" BadgeMargin="0,-14,-20,0" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge IsDot="True" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Reply}"/>
</controls:Badge>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -1,8 +1,8 @@
namespace HandyControlDemo.UserControl
{
public partial class NaiveComboBoxDemoCtl
public partial class BadgeDemoCtl
{
public NaiveComboBoxDemoCtl()
public BadgeDemoCtl()
{
InitializeComponent();
}

View File

@ -1,16 +0,0 @@
<UserControl x:Class="HandyControlDemo.UserControl.CircleProgressBarDemoCtl"
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 Orientation="Horizontal" Margin="32">
<controls:CircleProgressBar Value="50"/>
<controls:CircleProgressBar Value="80" FontSize="30" Margin="16,0,0,0"/>
<controls:CircleProgressBar Value="10" Margin="16,0,0,0" ShowText="False" Width="20" Height="20" ArcThickness="2" Style="{StaticResource ProgressBarSuccessCircle}"/>
<controls:CircleProgressBar Value="20" Margin="16,0,0,0" ShowText="False" Width="30" Height="30" ArcThickness="6" Style="{StaticResource ProgressBarInfoCircle}"/>
<controls:CircleProgressBar Value="40" Margin="16,0,0,0" ShowText="False" Width="40" Height="40" ArcThickness="10" Style="{StaticResource ProgressBarWarningCircle}"/>
<controls:CircleProgressBar Value="80" Margin="16,0,0,0" Width="50" Height="50" Style="{StaticResource ProgressBarDangerCircle}"/>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,8 @@
<UserControl x:Class="HandyControlDemo.UserControl.DialogDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="{DynamicResource RegionBrush}"
DataContext="{Binding DialogDemo,Source={StaticResource Locator}}">
<Button Margin="32" Content="{x:Static langs:Lang.TextDialog}" Command="{Binding ShowTextCmd}"/>
</UserControl>

View File

@ -1,8 +1,8 @@
namespace HandyControlDemo.UserControl
{
public partial class NaiveDatePickerDemoCtl
public partial class DialogDemoCtl
{
public NaiveDatePickerDemoCtl()
public DialogDemoCtl()
{
InitializeComponent();
}

View File

@ -4,10 +4,10 @@
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
Background="{DynamicResource RegionBrush}">
<controls:TransitioningContentControl>
<controls:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300">
<controls:GifImage.Source>
<controls:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300">
<controls:GifImage.Source>
<BitmapImage UriSource="/HandyControlDemo;component/Resources/Img/car_chase.gif"/>
</controls:GifImage.Source>
</controls:GifImage>
</controls:GifImage.Source>
</controls:GifImage>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,27 @@
<UserControl x:Class="HandyControlDemo.UserControl.GravatarDemoCtl"
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" Orientation="Horizontal">
<UniformGrid Rows="3" Columns="3" Width="240" Height="240">
<controls:Gravatar Id="User1"/>
<controls:Gravatar Id="User2"/>
<controls:Gravatar Style="{StaticResource GravatarCircleImg}">
<Image Source="/HandyControlDemo;component/Resources/Img/Album/2.jpg"/>
</controls:Gravatar>
<controls:Gravatar Id="User4"/>
<controls:Gravatar Id="User5" Style="{StaticResource GravatarCircle}"/>
<controls:Gravatar Id="User6"/>
<controls:Gravatar Style="{StaticResource GravatarCircle}" Source="/HandyControlDemo;component/Resources/Img/Album/1.jpg"/>
<controls:Gravatar Id="User8"/>
<controls:Gravatar Id="User9"/>
</UniformGrid>
<StackPanel Margin="16,0,0,0" Height="220" VerticalAlignment="Center">
<TextBox Text="User1" Name="TextBoxName" Width="180"/>
<controls:Gravatar Height="180" Width="180" Id="{Binding Text,ElementName=TextBoxName}" Margin="10"/>
</StackPanel>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -1,8 +1,8 @@
namespace HandyControlDemo.UserControl
{
public partial class NaiveDatePickerDemoCtl
public partial class GravatarDemoCtl
{
public NaiveDatePickerDemoCtl()
public GravatarDemoCtl()
{
InitializeComponent();
}

View File

@ -0,0 +1,31 @@
<UserControl x:Class="HandyControlDemo.UserControl.ProgressBarDemoCtl"
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">
<Slider Value="50" Name="SliderDemo" Maximum="100"/>
<StackPanel Orientation="Horizontal" Margin="0,32,0,0">
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" FontSize="30" Margin="16,0,0,0"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="20" Height="20" ArcThickness="2" Style="{StaticResource ProgressBarSuccessCircle}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="30" Height="30" ArcThickness="6" Style="{StaticResource ProgressBarInfoCircle}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="40" Height="40" ArcThickness="10" Style="{StaticResource ProgressBarWarningCircle}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" Width="50" Height="50" Style="{StaticResource ProgressBarDangerCircle}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,32,0,0">
<controls:WaveProgressBar Value="{Binding Value,ElementName=SliderDemo}"/>
<controls:WaveProgressBar Value="{Binding Value,ElementName=SliderDemo}" FontSize="20" Margin="16,0,0,0" WaveThickness="4" WaveStroke="#FFFF0080">
<controls:WaveProgressBar.WaveFill>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#66FF0080" Offset="0"/>
<GradientStop Color="#FFFF0080" Offset="1"/>
</LinearGradientBrush>
</controls:WaveProgressBar.WaveFill>
</controls:WaveProgressBar>
<controls:WaveProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="50" Height="50" Style="{StaticResource ProgressBarWarningWave}"/>
</StackPanel>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -59,7 +59,7 @@
<Image Source="../../Resources/Img/LeftMainContent/CheckBox_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveScrollViewerDemoCtl}" Content="{x:Static langs:Lang.ScrollViewer}">
<ListBoxItem Tag="{x:Static data:MessageToken.NativeScrollViewerDemoCtl}" Content="{x:Static langs:Lang.ScrollViewer}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
</controls:EdgeElement.LeftContent>
@ -74,17 +74,17 @@
<Image Source="../../Resources/Img/LeftMainContent/TextBlock_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveTextBoxDemoCtl}" Content="{x:Static langs:Lang.TextBox}">
<ListBoxItem Tag="{x:Static data:MessageToken.NativeTextBoxDemoCtl}" Content="{x:Static langs:Lang.TextBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/TextBox_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveComboBoxDemoCtl}" Content="{x:Static langs:Lang.ComboBox}">
<ListBoxItem Tag="{x:Static data:MessageToken.NativeComboBoxDemoCtl}" Content="{x:Static langs:Lang.ComboBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ComboBox_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.NaivePasswordBoxDemoCtl}" Content="{x:Static langs:Lang.PasswordBox}">
<ListBoxItem Tag="{x:Static data:MessageToken.NativePasswordBoxDemoCtl}" Content="{x:Static langs:Lang.PasswordBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/PasswordBox_16x.png"/>
</controls:EdgeElement.LeftContent>
@ -94,7 +94,7 @@
<Image Source="../../Resources/Img/LeftMainContent/Expander_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressBarDemoCtl}" Content="{x:Static langs:Lang.ProgressBar}">
<ListBoxItem Tag="{x:Static data:MessageToken.NativeProgressBarDemoCtl}" Content="{x:Static langs:Lang.ProgressBar}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ProgressBar_16x.png"/>
</controls:EdgeElement.LeftContent>
@ -104,12 +104,12 @@
<Image Source="../../Resources/Img/LeftMainContent/Calendar_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveDatePickerDemoCtl}" Content="{x:Static langs:Lang.DatePicker}">
<ListBoxItem Tag="{x:Static data:MessageToken.NativeDatePickerDemoCtl}" Content="{x:Static langs:Lang.DatePicker}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/DatePicker_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveTabControlDemoCtl}" Content="{x:Static langs:Lang.TabControl}">
<ListBoxItem Tag="{x:Static data:MessageToken.NativeTabControlDemoCtl}" Content="{x:Static langs:Lang.TabControl}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/TabPage_16x.png"/>
</controls:EdgeElement.LeftContent>
@ -188,17 +188,27 @@
</controls:StatusSwitchElement.CheckedElement>
</ToggleButton>
<ListBox Name="ListBoxControl" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.GravatarDemoCtl}" Content="{x:Static langs:Lang.Gravatar}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/User_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.BadgeDemoCtl}" Content="{x:Static langs:Lang.Badge}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/DotLarge_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.GotoTopDemoCtl}" Content="{x:Static langs:Lang.GotoTop}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/GoToTop_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ProgressButtonDemoCtl}" Content="{x:Static langs:Lang.ProgressButton}">
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressButtonDemoCtl}" Content="{x:Static langs:Lang.ProgressButton}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ProgressButton_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ChatBubbleDemoCtl}" Content="{x:Static langs:Lang.ChatBubble}">
<ListBoxItem Tag="{x:Static data:MessageToken.ChatBubbleDemoCtl}" Content="{x:Static langs:Lang.ChatBubble}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/Bubble_16xLG.png"/>
</controls:EdgeElement.LeftContent>
@ -248,7 +258,7 @@
<Image Source="../../Resources/Img/LeftMainContent/DatePicker_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.TransferDemoCtl}" Content="{x:Static langs:Lang.Transfer}">
<ListBoxItem Tag="{x:Static data:MessageToken.TransferDemoCtl}" Content="{x:Static langs:Lang.Transfer}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/Transfer_16x.png"/>
</controls:EdgeElement.LeftContent>
@ -303,14 +313,14 @@
<Image Source="../../Resources/Img/LeftMainContent/DetailDataView_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.CoverFlowDemoCtl}" Content="{x:Static langs:Lang.CoverFlow}">
<ListBoxItem Tag="{x:Static data:MessageToken.CoverFlowDemoCtl}" Content="{x:Static langs:Lang.CoverFlow}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/LinearCarousel_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CircleProgressBarDemoCtl}" Content="{x:Static langs:Lang.CircleProgressBar}">
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ProgressBarDemoCtl}" Content="{x:Static langs:Lang.ProgressBar}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ShapeArcRing_16x.png"/>
<Image Source="../../Resources/Img/LeftMainContent/ProgressBar_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.StepBarDemoCtl}" Content="{x:Static langs:Lang.StepBar}">
@ -378,7 +388,12 @@
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.DialogDemoCtl}" Content="{x:Static langs:Lang.Dialog}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/Dialog_16x.png"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem 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>

View File

@ -0,0 +1,17 @@
<UserControl x:Class="HandyControlDemo.UserControl.UnderConstruction"
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"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="{DynamicResource RegionBrush}">
<controls:TransitioningContentControl>
<StackPanel Margin="32">
<controls:GifImage Width="400" Height="300">
<controls:GifImage.Source>
<BitmapImage UriSource="/HandyControlDemo;component/Resources/Img/under_construction.gif"/>
</controls:GifImage.Source>
</controls:GifImage>
<TextBlock Margin="0,16,0,0" HorizontalAlignment="Center" Text="{x:Static langs:Lang.ComingSoon}" Style="{StaticResource TextBlockLargeBold}"/>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class UnderConstruction
{
public UnderConstruction()
{
InitializeComponent();
}
}
}

View File

@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.NaiveComboBoxDemoCtl"
<UserControl x:Class="HandyControlDemo.UserControl.NativeComboBoxDemoCtl"
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"

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class NativeComboBoxDemoCtl
{
public NativeComboBoxDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.NaiveDatePickerDemoCtl"
<UserControl x:Class="HandyControlDemo.UserControl.NativeDatePickerDemoCtl"
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"

View File

@ -1,8 +1,8 @@
namespace HandyControlDemo.UserControl
{
public partial class NaivePasswordBoxDemoCtl
public partial class NativeDatePickerDemoCtl
{
public NaivePasswordBoxDemoCtl()
public NativeDatePickerDemoCtl()
{
InitializeComponent();
}

View File

@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.NaivePasswordBoxDemoCtl"
<UserControl x:Class="HandyControlDemo.UserControl.NativePasswordBoxDemoCtl"
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"

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class NativePasswordBoxDemoCtl
{
public NativePasswordBoxDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.ProgressBarDemoCtl"
<UserControl x:Class="HandyControlDemo.UserControl.NativeProgressBarDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{DynamicResource RegionBrush}"

View File

@ -1,9 +1,9 @@

namespace HandyControlDemo.UserControl
{
public partial class NaiveScrollViewerDemoCtl
public partial class NativeProgressBarDemoCtl
{
public NaiveScrollViewerDemoCtl()
public NativeProgressBarDemoCtl()
{
InitializeComponent();
}

View File

@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.NaiveScrollViewerDemoCtl"
<UserControl x:Class="HandyControlDemo.UserControl.NativeScrollViewerDemoCtl"
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"

View File

@ -0,0 +1,11 @@

namespace HandyControlDemo.UserControl
{
public partial class NativeScrollViewerDemoCtl
{
public NativeScrollViewerDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.NaiveTabControlDemoCtl"
<UserControl x:Class="HandyControlDemo.UserControl.NativeTabControlDemoCtl"
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"

View File

@ -1,9 +1,9 @@

namespace HandyControlDemo.UserControl
{
public partial class NaiveTabControlDemoCtl
public partial class NativeTabControlDemoCtl
{
public NaiveTabControlDemoCtl()
public NativeTabControlDemoCtl()
{
InitializeComponent();
}

View File

@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.NaiveTextBoxDemoCtl"
<UserControl x:Class="HandyControlDemo.UserControl.NativeTextBoxDemoCtl"
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"

View File

@ -1,9 +1,9 @@

namespace HandyControlDemo.UserControl
{
public partial class NaiveTextBoxDemoCtl
public partial class NativeTextBoxDemoCtl
{
public NaiveTextBoxDemoCtl()
public NativeTextBoxDemoCtl()
{
InitializeComponent();
}

View File

@ -0,0 +1,19 @@
using System;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
using HandyControl.Controls;
using HandyControlDemo.UserControl;
namespace HandyControlDemo.ViewModel
{
public class DialogDemoViewModel : ViewModelBase
{
public RelayCommand ShowTextCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(ShowText)).Value;
private void ShowText()
{
Dialog.Show(new TextDialog());
}
}
}

View File

@ -24,6 +24,7 @@ namespace HandyControlDemo.ViewModel
SimpleIoc.Default.Register<PaginationDemoViewModel>();
SimpleIoc.Default.Register<ChatBoxViewModel>();
SimpleIoc.Default.Register<CoverViewModel>();
SimpleIoc.Default.Register<DialogDemoViewModel>();
}
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
@ -51,6 +52,8 @@ namespace HandyControlDemo.ViewModel
public CoverViewModel CoverView => ServiceLocator.Current.GetInstance<CoverViewModel>();
public DialogDemoViewModel DialogDemo => ServiceLocator.Current.GetInstance<DialogDemoViewModel>();
#endregion
}
}

View File

@ -36,7 +36,7 @@
public static readonly string PreviewSliderDemoCtl = nameof(PreviewSliderDemoCtl);
public static readonly string CircleProgressBarDemoCtl = nameof(CircleProgressBarDemoCtl);
public static readonly string ProgressBarDemoCtl = nameof(ProgressBarDemoCtl);
public static readonly string TextBoxDemoCtl = nameof(TextBoxDemoCtl);
@ -84,29 +84,33 @@
public static readonly string GotoTopDemoCtl = nameof(GotoTopDemoCtl);
public static readonly string BadgeDemoCtl = nameof(BadgeDemoCtl);
public static readonly string GravatarDemoCtl = nameof(GravatarDemoCtl);
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
public static readonly string ExpanderDemoCtl = nameof(ExpanderDemoCtl);
public static readonly string ProgressBarDemoCtl = nameof(ProgressBarDemoCtl);
public static readonly string NativeProgressBarDemoCtl = nameof(NativeProgressBarDemoCtl);
public static readonly string TabControlDemoCtl = nameof(TabControlDemoCtl);
public static readonly string CalendarDemoCtl = nameof(CalendarDemoCtl);
public static readonly string NaiveDatePickerDemoCtl = nameof(NaiveDatePickerDemoCtl);
public static readonly string NativeDatePickerDemoCtl = nameof(NativeDatePickerDemoCtl);
public static readonly string NaiveTextBoxDemoCtl = nameof(NaiveTextBoxDemoCtl);
public static readonly string NativeTextBoxDemoCtl = nameof(NativeTextBoxDemoCtl);
public static readonly string TextBlockDemoCtl = nameof(TextBlockDemoCtl);
public static readonly string NaiveComboBoxDemoCtl = nameof(NaiveComboBoxDemoCtl);
public static readonly string NativeComboBoxDemoCtl = nameof(NativeComboBoxDemoCtl);
public static readonly string NaivePasswordBoxDemoCtl = nameof(NaivePasswordBoxDemoCtl);
public static readonly string NativePasswordBoxDemoCtl = nameof(NativePasswordBoxDemoCtl);
public static readonly string NaiveTabControlDemoCtl = nameof(NaiveTabControlDemoCtl);
public static readonly string NativeTabControlDemoCtl = nameof(NativeTabControlDemoCtl);
public static readonly string DataGridDemoCtl = nameof(DataGridDemoCtl);
@ -122,7 +126,7 @@
public static readonly string RadioButtonDemoCtl = nameof(RadioButtonDemoCtl);
public static readonly string NaiveScrollViewerDemoCtl = nameof(NaiveScrollViewerDemoCtl);
public static readonly string NativeScrollViewerDemoCtl = nameof(NativeScrollViewerDemoCtl);
public static readonly string BrushDemoCtl = nameof(BrushDemoCtl);

View File

@ -21,7 +21,7 @@ var controlList = new List<string>
"WindowDemoCtl",
"ScrollViewerDemoCtl",
"PreviewSliderDemoCtl",
"CircleProgressBarDemoCtl",
"ProgressBarDemoCtl",
"TextBoxDemoCtl",
"ComboBoxDemoCtl",
"PasswordBoxDemoCtl",
@ -44,22 +44,24 @@ var controlList = new List<string>
"ProgressButtonDemoCtl",
"TransferDemoCtl",
"ChatBubbleDemoCtl",
"GotoTopDemoCtl"
"GotoTopDemoCtl",
"BadgeDemoCtl",
"GravatarDemoCtl"
};
var styleList = new List<string>
{
"ButtonDemoCtl",
"ToggleButtonDemoCtl",
"ExpanderDemoCtl",
"ProgressBarDemoCtl",
"NativeProgressBarDemoCtl",
"TabControlDemoCtl",
"CalendarDemoCtl",
"NaiveDatePickerDemoCtl",
"NaiveTextBoxDemoCtl",
"NativeDatePickerDemoCtl",
"NativeTextBoxDemoCtl",
"TextBlockDemoCtl",
"NaiveComboBoxDemoCtl",
"NaivePasswordBoxDemoCtl",
"NaiveTabControlDemoCtl",
"NativeComboBoxDemoCtl",
"NativePasswordBoxDemoCtl",
"NativeTabControlDemoCtl",
"DataGridDemoCtl",
"CheckBoxDemoCtl",
"ListBoxDemoCtl",
@ -67,7 +69,7 @@ var styleList = new List<string>
"TreeViewDemoCtl",
"BorderDemoCtl",
"RadioButtonDemoCtl",
"NaiveScrollViewerDemoCtl",
"NativeScrollViewerDemoCtl",
"BrushDemoCtl",
"SliderDemoCtl",
"GroupBoxDemoCtl",

View File

@ -112,6 +112,9 @@
<Compile Include="UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\BadgeDemoCtl.xaml.cs">
<DependentUpon>BadgeDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\CalendarWithClockDemoCtl.xaml.cs">
<DependentUpon>CalendarWithClockDemoCtl.xaml</DependentUpon>
</Compile>
@ -124,8 +127,8 @@
<Compile Include="UserControl\Controls\CirclePanelDemoCtl.xaml.cs">
<DependentUpon>CirclePanelDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\CircleProgressBarDemoCtl.xaml.cs">
<DependentUpon>CircleProgressBarDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Controls\ProgressBarDemoCtl.xaml.cs">
<DependentUpon>ProgressBarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\ClockDemoCtl.xaml.cs">
<DependentUpon>ClockDemoCtl.xaml</DependentUpon>
@ -157,6 +160,9 @@
<Compile Include="UserControl\Controls\GotoTopDemoCtl.xaml.cs">
<DependentUpon>GotoTopDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\GravatarDemoCtl.xaml.cs">
<DependentUpon>GravatarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\OutlineTextDemoCtl.xaml.cs">
<DependentUpon>OutlineTextDemoCtl.xaml</DependentUpon>
</Compile>
@ -226,6 +232,9 @@
<Compile Include="UserControl\Main\QQGroupView.xaml.cs">
<DependentUpon>QQGroupView.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Main\UnderConstruction.xaml.cs">
<DependentUpon>UnderConstruction.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\BorderDemoCtl.xaml.cs">
<DependentUpon>BorderDemoCtl.xaml</DependentUpon>
</Compile>
@ -250,14 +259,14 @@
<Compile Include="UserControl\Styles\ListViewDemoCtl.xaml.cs">
<DependentUpon>ListViewDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveComboBoxDemoCtl.xaml.cs">
<DependentUpon>NaiveComboBoxDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeComboBoxDemoCtl.xaml.cs">
<DependentUpon>NativeComboBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\DataGridDemoCtl.xaml.cs">
<DependentUpon>DataGridDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveDatePickerDemoCtl.xaml.cs">
<DependentUpon>NaiveDatePickerDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeDatePickerDemoCtl.xaml.cs">
<DependentUpon>NativeDatePickerDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ExpanderDemoCtl.xaml.cs">
<DependentUpon>ExpanderDemoCtl.xaml</DependentUpon>
@ -280,17 +289,17 @@
<Compile Include="UserControl\Styles\MenuDemoCtl.xaml.cs">
<DependentUpon>MenuDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveScrollViewerDemoCtl.xaml.cs">
<DependentUpon>NaiveScrollViewerDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeScrollViewerDemoCtl.xaml.cs">
<DependentUpon>NativeScrollViewerDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveTabControlDemoCtl.xaml.cs">
<DependentUpon>NaiveTabControlDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeTabControlDemoCtl.xaml.cs">
<DependentUpon>NativeTabControlDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaivePasswordBoxDemoCtl.xaml.cs">
<DependentUpon>NaivePasswordBoxDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativePasswordBoxDemoCtl.xaml.cs">
<DependentUpon>NativePasswordBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ProgressBarDemoCtl.xaml.cs">
<DependentUpon>ProgressBarDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeProgressBarDemoCtl.xaml.cs">
<DependentUpon>NativeProgressBarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\TabControlDemoCtl.xaml.cs">
<DependentUpon>TabControlDemoCtl.xaml</DependentUpon>
@ -307,8 +316,8 @@
<Compile Include="UserControl\Styles\TextBlockDemoCtl.xaml.cs">
<DependentUpon>TextBlockDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveTextBoxDemoCtl.xaml.cs">
<DependentUpon>NaiveTextBoxDemoCtl.xaml</DependentUpon>
<Compile Include="UserControl\Styles\NativeTextBoxDemoCtl.xaml.cs">
<DependentUpon>NativeTextBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ToggleButtonDemoCtl.xaml.cs">
<DependentUpon>ToggleButtonDemoCtl.xaml</DependentUpon>
@ -414,6 +423,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\BadgeDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\CalendarWithClockDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -430,7 +443,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\CircleProgressBarDemoCtl.xaml">
<Page Include="UserControl\Controls\ProgressBarDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -474,6 +487,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\GravatarDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\OutlineTextDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -566,6 +583,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Main\UnderConstruction.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\BorderDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -598,7 +619,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveComboBoxDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeComboBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -606,7 +627,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveDatePickerDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeDatePickerDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -638,19 +659,19 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveScrollViewerDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeScrollViewerDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveTabControlDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeTabControlDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaivePasswordBoxDemoCtl.xaml">
<Page Include="UserControl\Styles\NativePasswordBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\ProgressBarDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeProgressBarDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -674,7 +695,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveTextBoxDemoCtl.xaml">
<Page Include="UserControl\Styles\NativeTextBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -732,6 +753,9 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput>
</Content>
<Resource Include="Resources\Img\LeftMainContent\DotLarge_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\User_16x.png" />
<Resource Include="Resources\Img\under_construction.gif" />
<Resource Include="Resources\Img\LeftMainContent\GoToTop_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Label_16x.png" />
<Resource Include="Resources\Img\Chat\chat_back1.jpg" />
@ -798,7 +822,6 @@
<Resource Include="Resources\Img\LeftMainContent\Flow_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\TimePicker_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Time_color_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\ShapeArcRing_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\NumericListBox_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Toggle_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\DataGrid_16x.png" />

View File

@ -87,6 +87,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 标记 的本地化字符串。
/// </summary>
public static string Badge {
get {
return ResourceManager.GetString("Badge", resourceCulture);
}
}
/// <summary>
/// 查找类似 填写基本信息 的本地化字符串。
/// </summary>
@ -213,15 +222,6 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 圆形进度条 的本地化字符串。
/// </summary>
public static string CircleProgressBar {
get {
return ResourceManager.GetString("CircleProgressBar", resourceCulture);
}
}
/// <summary>
/// 查找类似 清空 的本地化字符串。
/// </summary>
@ -258,6 +258,24 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 敬请期待 的本地化字符串。
/// </summary>
public static string ComingSoon {
get {
return ResourceManager.GetString("ComingSoon", resourceCulture);
}
}
/// <summary>
/// 查找类似 评论 的本地化字符串。
/// </summary>
public static string Comment {
get {
return ResourceManager.GetString("Comment", resourceCulture);
}
}
/// <summary>
/// 查找类似 一般 的本地化字符串。
/// </summary>
@ -447,6 +465,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 头像 的本地化字符串。
/// </summary>
public static string Gravatar {
get {
return ResourceManager.GetString("Gravatar", resourceCulture);
}
}
/// <summary>
/// 查找类似 分组框 的本地化字符串。
/// </summary>
@ -888,6 +915,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 回复 的本地化字符串。
/// </summary>
public static string Reply {
get {
return ResourceManager.GetString("Reply", resourceCulture);
}
}
/// <summary>
/// 查找类似 代码仓库 的本地化字符串。
/// </summary>

View File

@ -387,9 +387,6 @@
<data name="Slider" xml:space="preserve">
<value>Slider</value>
</data>
<data name="CircleProgressBar" xml:space="preserve">
<value>CircleProgressBar</value>
</data>
<data name="IsNotPhone" xml:space="preserve">
<value>It's not a phone number</value>
</data>
@ -501,4 +498,19 @@
<data name="GotoTop" xml:space="preserve">
<value>GotoTop</value>
</data>
<data name="Badge" xml:space="preserve">
<value>Badge</value>
</data>
<data name="Gravatar" xml:space="preserve">
<value>Gravatar</value>
</data>
<data name="ComingSoon" xml:space="preserve">
<value>ComingSoon</value>
</data>
<data name="Comment" xml:space="preserve">
<value>Comment</value>
</data>
<data name="Reply" xml:space="preserve">
<value>Reply</value>
</data>
</root>

View File

@ -387,9 +387,6 @@
<data name="Slider" xml:space="preserve">
<value>滑块</value>
</data>
<data name="CircleProgressBar" xml:space="preserve">
<value>圆形进度条</value>
</data>
<data name="IsNotPhone" xml:space="preserve">
<value>不是手机号码</value>
</data>
@ -501,4 +498,19 @@
<data name="GotoTop" xml:space="preserve">
<value>回到顶部</value>
</data>
<data name="Badge" xml:space="preserve">
<value>标记</value>
</data>
<data name="Gravatar" xml:space="preserve">
<value>头像</value>
</data>
<data name="ComingSoon" xml:space="preserve">
<value>敬请期待</value>
</data>
<data name="Comment" xml:space="preserve">
<value>评论</value>
</data>
<data name="Reply" xml:space="preserve">
<value>回复</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 KiB

View File

@ -36,7 +36,7 @@ namespace HandyControlDemo.Service
Name = $"Name{i}",
Type = (DemoType)i,
DataList = dataList,
ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i % 7}.png",
ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i % 6 + 1}.png",
Remark = new string(i.ToString()[0], 10)
};
list.Add(model);

View File

@ -4,6 +4,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
<controls:TransitioningContentControl>
<controls:AnimationPath VerticalAlignment="Center" Margin="32" PathLength="400" Duration="0:0:4" Stretch="Uniform" Width="200" Height="200" StrokeThickness="2" Stroke="{DynamicResource PrimaryBrush}" Data="M40.493382,19.001303 C36.637875,19.06448 33.938568,21.421986 33.948524,25.271919 L34.068279,71.56765 34.066906,71.598007 34.068745,71.747833 34.18895,118.21758 C34.202225,123.35083 39.026951,129.19344 44.965271,131.2674 50.903587,133.34137 55.706783,130.86133 55.693504,125.72808 L55.589508,85.524513 93.866371,85.524513 93.950943,118.21758 C93.964218,123.35083 98.788948,129.19344 104.72726,131.2674 110.66558,133.34137 115.46878,130.86133 115.4555,125.72808 L115.33575,79.432381 115.33712,79.401993 115.33528,79.252007 115.21507,32.782413 C115.2018,27.64917 110.37708,21.806566 104.43876,19.732603 98.500435,17.658638 93.697243,20.138674 93.710518,25.271919 L93.814514,65.475487 55.537647,65.475487 55.453079,32.782413 C55.439804,27.64917 50.615082,21.806566 44.676762,19.732603 43.192181,19.214111 41.778549,18.980244 40.493382,19.001303 z M9.999999,0 L140,0 C145.52284,0 150,4.4771523 150,9.999999 L150,140 C150,145.52284 145.52284,150 140,150 L9.999999,150 C4.4771523,150 0,145.52284 0,140 L0,9.999999 C0,4.4771523 4.4771523,0 9.999999,0 z"/>
<Viewbox Margin="32" Width="200" Height="200">
<controls:AnimationPath VerticalAlignment="Center" Duration="0:0:6" Stretch="Uniform" Width="1024" Height="1024" StrokeThickness="10" Stroke="{DynamicResource PrimaryBrush}" Data="{StaticResource GithubGeometry}"/>
</Viewbox>
</controls:TransitioningContentControl>
</UserControl>
</UserControl>

View File

@ -0,0 +1,26 @@
<UserControl x:Class="HandyControlDemo.UserControl.BadgeDemoCtl"
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"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="{DynamicResource RegionBrush}">
<controls:TransitioningContentControl>
<StackPanel Margin="32" Orientation="Horizontal">
<controls:Badge Text="New" BadgeMargin="0,-14,-20,0" Height="30">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge Text="New" BadgeMargin="0,-14,-20,0" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge Value="1" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgePrimary}">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge Value="100" BadgeMargin="0,-14,-20,0" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge IsDot="True" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Reply}"/>
</controls:Badge>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class BadgeDemoCtl
{
public BadgeDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -1,16 +0,0 @@
<UserControl x:Class="HandyControlDemo.UserControl.CircleProgressBarDemoCtl"
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 Orientation="Horizontal" Margin="32">
<controls:CircleProgressBar Value="50"/>
<controls:CircleProgressBar Value="80" FontSize="30" Margin="16,0,0,0"/>
<controls:CircleProgressBar Value="10" Margin="16,0,0,0" ShowText="False" Width="20" Height="20" ArcThickness="2" Style="{StaticResource ProgressBarSuccessCircle}"/>
<controls:CircleProgressBar Value="20" Margin="16,0,0,0" ShowText="False" Width="30" Height="30" ArcThickness="6" Style="{StaticResource ProgressBarInfoCircle}"/>
<controls:CircleProgressBar Value="40" Margin="16,0,0,0" ShowText="False" Width="40" Height="40" ArcThickness="10" Style="{StaticResource ProgressBarWarningCircle}"/>
<controls:CircleProgressBar Value="80" Margin="16,0,0,0" Width="50" Height="50" Style="{StaticResource ProgressBarDangerCircle}"/>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -1,11 +0,0 @@

namespace HandyControlDemo.UserControl
{
public partial class CircleProgressBarDemoCtl
{
public CircleProgressBarDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -4,10 +4,10 @@
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
Background="{DynamicResource RegionBrush}">
<controls:TransitioningContentControl>
<controls:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300">
<controls:GifImage.Source>
<controls:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300">
<controls:GifImage.Source>
<BitmapImage UriSource="/HandyControlDemo;component/Resources/Img/car_chase.gif"/>
</controls:GifImage.Source>
</controls:GifImage>
</controls:GifImage.Source>
</controls:GifImage>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,27 @@
<UserControl x:Class="HandyControlDemo.UserControl.GravatarDemoCtl"
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" Orientation="Horizontal">
<UniformGrid Rows="3" Columns="3" Width="240" Height="240">
<controls:Gravatar Id="User1"/>
<controls:Gravatar Id="User2"/>
<controls:Gravatar Style="{StaticResource GravatarCircleImg}">
<Image Source="/HandyControlDemo;component/Resources/Img/Album/2.jpg"/>
</controls:Gravatar>
<controls:Gravatar Id="User4"/>
<controls:Gravatar Id="User5" Style="{StaticResource GravatarCircle}"/>
<controls:Gravatar Id="User6"/>
<controls:Gravatar Style="{StaticResource GravatarCircle}" Source="/HandyControlDemo;component/Resources/Img/Album/1.jpg"/>
<controls:Gravatar Id="User8"/>
<controls:Gravatar Id="User9"/>
</UniformGrid>
<StackPanel Margin="16,0,0,0" Height="220" VerticalAlignment="Center">
<TextBox Text="User1" Name="TextBoxName" Width="180"/>
<controls:Gravatar Height="180" Width="180" Id="{Binding Text,ElementName=TextBoxName}" Margin="10"/>
</StackPanel>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class GravatarDemoCtl
{
public GravatarDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,31 @@
<UserControl x:Class="HandyControlDemo.UserControl.ProgressBarDemoCtl"
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">
<Slider Value="50" Name="SliderDemo" Maximum="100"/>
<StackPanel Orientation="Horizontal" Margin="0,32,0,0">
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" FontSize="30" Margin="16,0,0,0"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="20" Height="20" ArcThickness="2" Style="{StaticResource ProgressBarSuccessCircle}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="30" Height="30" ArcThickness="6" Style="{StaticResource ProgressBarInfoCircle}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="40" Height="40" ArcThickness="10" Style="{StaticResource ProgressBarWarningCircle}"/>
<controls:CircleProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" Width="50" Height="50" Style="{StaticResource ProgressBarDangerCircle}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,32,0,0">
<controls:WaveProgressBar Value="{Binding Value,ElementName=SliderDemo}"/>
<controls:WaveProgressBar Value="{Binding Value,ElementName=SliderDemo}" FontSize="20" Margin="16,0,0,0" WaveThickness="4" WaveStroke="#FFFF0080">
<controls:WaveProgressBar.WaveFill>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#66FF0080" Offset="0"/>
<GradientStop Color="#FFFF0080" Offset="1"/>
</LinearGradientBrush>
</controls:WaveProgressBar.WaveFill>
</controls:WaveProgressBar>
<controls:WaveProgressBar Value="{Binding Value,ElementName=SliderDemo}" Margin="16,0,0,0" ShowText="False" Width="50" Height="50" Style="{StaticResource ProgressBarWarningWave}"/>
</StackPanel>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>

Some files were not shown because too many files have changed in this diff Show More