diff --git a/HandyControl/Data/ResourceToken.cs b/HandyControl/Data/ResourceToken.cs index ab9f77ed..bba58672 100644 --- a/HandyControl/Data/ResourceToken.cs +++ b/HandyControl/Data/ResourceToken.cs @@ -1,6 +1,6 @@ namespace HandyControl.Data { - public class ResourceToken + public class ResourceToken { public const string SuccessGeometry = nameof(SuccessGeometry); diff --git a/HandyControl/Data/ResourceToken.tt b/HandyControl/Data/ResourceToken.tt deleted file mode 100644 index 77ae0102..00000000 --- a/HandyControl/Data/ResourceToken.tt +++ /dev/null @@ -1,63 +0,0 @@ -<#@ template debug="false" hostspecific="false" language="C#" #> -<#@ import namespace="System.Collections.Generic"#> -<#@ output extension=".cs" #> -<# -var geometryList = new List -{ - "SuccessGeometry", - "InfoGeometry", - "ErrorGeometry", - "WarningGeometry", - "AskGeometry", - "FatalGeometry", - "PrimaryBrush" -}; -var brushList = new List -{ - "SuccessBrush", - "InfoBrush", - "DangerBrush", - "WarningBrush", - "AccentBrush", - "PrimaryTextBrush", - "ThirdlyTextBrush", - "BlurGradientValue" -}; -var styleList = new List -{ - "ButtonCustom", - "PaginationButtonStyle", - "WindowWin10", - "AddTagButtonStyle", - "RadioGroupItemDefault", - "RadioGroupItemSingle", - "RadioGroupItemHorizontalFirst", - "RadioGroupItemHorizontalLast", - "RadioGroupItemVerticalFirst", - "RadioGroupItemVerticalLast", - "TabItemCapsuleDefault", - "TabItemCapsuleSingle", - "TabItemCapsuleHorizontalFirst", - "TabItemCapsuleHorizontalLast", - "TabItemCapsuleVerticalFirst", - "TabItemCapsuleVerticalLast" -}; -#> -namespace HandyControl.Data -{ - internal class ResourceToken - { - <#foreach(var item in geometryList){#> - public const string <#=item#> = nameof(<#=item#>); - - <#}#> -<#foreach(var item in brushList){#> - public const string <#=item#> = nameof(<#=item#>); - - <#}#> -<#foreach(var item in styleList){#> - public const string <#=item#> = nameof(<#=item#>); - - <#}#> -} -} \ No newline at end of file diff --git a/HandyControl/HandyControl.csproj b/HandyControl/HandyControl.csproj index 9d037710..0b3cdcc7 100644 --- a/HandyControl/HandyControl.csproj +++ b/HandyControl/HandyControl.csproj @@ -170,6 +170,7 @@ + @@ -179,11 +180,6 @@ - - True - True - ResourceToken.tt - @@ -771,12 +767,6 @@ Designer - - - TextTemplatingFileGenerator - ResourceToken.cs - - diff --git a/Net40/HandyControlDemo_Net40/App.xaml.cs b/Net40/HandyControlDemo_Net40/App.xaml.cs index 4be12a85..db6d4d17 100644 --- a/Net40/HandyControlDemo_Net40/App.xaml.cs +++ b/Net40/HandyControlDemo_Net40/App.xaml.cs @@ -1,5 +1,7 @@ using System; using System.Globalization; +using System.Net; +using System.Security.Authentication; using System.Threading; using System.Windows; using HandyControl.Controls; @@ -28,6 +30,8 @@ namespace HandyControlDemo } BlurWindow.SystemVersionInfo = CommonHelper.GetSystemVersionInfo(); + + ServicePointManager.SecurityProtocol = (SecurityProtocolType)(SslProtocols)0x00000C00; } protected override void OnExit(ExitEventArgs e) diff --git a/Net40/HandyControlDemo_Net40/Data/AppConfig.cs b/Net40/HandyControlDemo_Net40/Data/AppConfig.cs index 1768fb96..0084a625 100644 --- a/Net40/HandyControlDemo_Net40/Data/AppConfig.cs +++ b/Net40/HandyControlDemo_Net40/Data/AppConfig.cs @@ -5,7 +5,7 @@ namespace HandyControlDemo.Data { internal class AppConfig { - public static string SavePath = $"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json"; + public static readonly string SavePath = $"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json"; public string Lang { get; set; } = "zh-cn"; diff --git a/Net40/HandyControlDemo_Net40/Data/GlobalData.cs b/Net40/HandyControlDemo_Net40/Data/GlobalData.cs index 0846ca13..9c0f9f69 100644 --- a/Net40/HandyControlDemo_Net40/Data/GlobalData.cs +++ b/Net40/HandyControlDemo_Net40/Data/GlobalData.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using Newtonsoft.Json; namespace HandyControlDemo.Data diff --git a/Net40/HandyControlDemo_Net40/Data/MessageToken.cs b/Net40/HandyControlDemo_Net40/Data/MessageToken.cs index 739b20bb..1669743c 100644 --- a/Net40/HandyControlDemo_Net40/Data/MessageToken.cs +++ b/Net40/HandyControlDemo_Net40/Data/MessageToken.cs @@ -76,6 +76,12 @@ public static readonly string CoverFlowDemoCtl = nameof(CoverFlowDemoCtl); + public static readonly string ProgressButtonDemoCtl = nameof(ProgressButtonDemoCtl); + + public static readonly string TransferDemoCtl = nameof(TransferDemoCtl); + + public static readonly string ChatBubbleDemoCtl = nameof(ChatBubbleDemoCtl); + public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl); public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl); @@ -132,12 +138,15 @@ public static readonly string CustomNonClientAreaWindow = nameof(CustomNonClientAreaWindow); - public static readonly string LoadShowContent = nameof(LoadShowContent); + public static readonly string LoadShowContent = nameof(LoadShowContent); - public static readonly string FullSwitch = nameof(FullSwitch); + public static readonly string FullSwitch = nameof(FullSwitch); - public static readonly string ContributorsView = nameof(ContributorsView); + public static readonly string ContributorsView = nameof(ContributorsView); - public static readonly string ClearLeftSelected = nameof(ClearLeftSelected); - } + public static readonly string ClearLeftSelected = nameof(ClearLeftSelected); + + public static readonly string SendChatMessage = nameof(SendChatMessage); + + } } \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/Data/MessageToken.tt b/Net40/HandyControlDemo_Net40/Data/MessageToken.tt index 4962b589..f25d34ce 100644 --- a/Net40/HandyControlDemo_Net40/Data/MessageToken.tt +++ b/Net40/HandyControlDemo_Net40/Data/MessageToken.tt @@ -40,7 +40,10 @@ var controlList = new List "ShieldDemoCtl", "WaterfallPanelDemoCtl", "CoverViewDemoCtl", - "CoverFlowDemoCtl" + "CoverFlowDemoCtl", + "ProgressButtonDemoCtl", + "TransferDemoCtl", + "ChatBubbleDemoCtl" }; var styleList = new List { @@ -76,6 +79,14 @@ var windowList = new List "CommonWindow", "CustomNonClientAreaWindow" }; +var messageList = new List +{ + "LoadShowContent", + "FullSwitch", + "ContributorsView", + "ClearLeftSelected", + "SendChatMessage" +}; #> namespace HandyControlDemo.Data { @@ -93,12 +104,9 @@ namespace HandyControlDemo.Data public static readonly string <#=item#> = nameof(<#=item#>); <#}#> - public static readonly string LoadShowContent = nameof(LoadShowContent); +<#foreach(var item in messageList){#> + public static readonly string <#=item#> = nameof(<#=item#>); - public static readonly string FullSwitch = nameof(FullSwitch); - - public static readonly string ContributorsView = nameof(ContributorsView); - - public static readonly string ClearLeftSelected = nameof(ClearLeftSelected); - } + <#}#> +} } \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/Data/Model/ChatInfoModel.cs b/Net40/HandyControlDemo_Net40/Data/Model/ChatInfoModel.cs new file mode 100644 index 00000000..92b4e3a1 --- /dev/null +++ b/Net40/HandyControlDemo_Net40/Data/Model/ChatInfoModel.cs @@ -0,0 +1,17 @@ +using HandyControl.Data; + +namespace HandyControlDemo.Data +{ + public struct ChatInfoModel + { + public object Message { get; set; } + + public string SenderId { get; set; } + + public ChatRoleType Role { get; set; } + + public ChatMessageType Type { get; set; } + + public object Enclosure { get; set; } + } +} \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/HandyControlDemo_Net40.csproj b/Net40/HandyControlDemo_Net40/HandyControlDemo_Net40.csproj index 6bda4e34..adcbe810 100644 --- a/Net40/HandyControlDemo_Net40/HandyControlDemo_Net40.csproj +++ b/Net40/HandyControlDemo_Net40/HandyControlDemo_Net40.csproj @@ -82,6 +82,7 @@ True MessageToken.tt + @@ -96,12 +97,16 @@ Lang.en.resx - - + + + Avatar.xaml + + ChatBox.xaml + AnimationPathDemoCtl.xaml @@ -111,6 +116,9 @@ CarouselDemoCtl.xaml + + ChatBubbleDemoCtl.xaml + CirclePanelDemoCtl.xaml @@ -168,6 +176,9 @@ PreviewSliderDemoCtl.xaml + + ProgressButtonDemoCtl.xaml + RateDemoCtl.xaml @@ -192,6 +203,9 @@ TimePickerDemoCtl.xaml + + TransferDemoCtl.xaml + WaterfallPanelDemoCtl.xaml @@ -297,15 +311,16 @@ TreeViewDemoCtl.xaml - - - - - - - + + + + + + + + - + AboutWindow.xaml @@ -381,6 +396,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -393,6 +412,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -469,6 +492,10 @@ Designer MSBuild:Compile + + Designer + XamlIntelliSenseFileGenerator + Designer MSBuild:Compile @@ -501,6 +528,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -683,6 +714,11 @@ TextTemplatingFileGenerator MessageToken.cs + + + + + diff --git a/Net40/HandyControlDemo_Net40/MainWindow.xaml b/Net40/HandyControlDemo_Net40/MainWindow.xaml index 8688db0c..99344426 100644 --- a/Net40/HandyControlDemo_Net40/MainWindow.xaml +++ b/Net40/HandyControlDemo_Net40/MainWindow.xaml @@ -1,23 +1,26 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl" + xmlns:userControl="clr-namespace:HandyControlDemo.UserControl" + mc:Ignorable="d" + BorderThickness="1" + BorderBrush="#262e2f" + NonClientAreaBackground="#262e2f" + OtherButtonHoverBackground="#888580" + CloseButtonForeground="White" + OtherButtonHoverForeground="White" + OtherButtonForeground="White" + Style="{StaticResource WindowBlur}" + WindowState="Maximized" + Title="MainWindow" + ResizeMode="CanResizeWithGrip" + Name="MyWindow" + DataContext="{Binding Main,Source={StaticResource Locator}}" + d:DesignHeight="800" + d:DesignWidth="1400"> diff --git a/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.Designer.cs b/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.Designer.cs index a19f2900..5c2fd6c9 100644 --- a/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.Designer.cs +++ b/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.Designer.cs @@ -177,6 +177,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 对话气泡 的本地化字符串。 + /// + public static string ChatBubble { + get { + return ResourceManager.GetString("ChatBubble", resourceCulture); + } + } + /// /// 查找类似 讨论室 的本地化字符串。 /// @@ -654,6 +663,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 点击打开自定义消息窗口 的本地化字符串。 + /// + public static string OpenCustomMessageWindow { + get { + return ResourceManager.GetString("OpenCustomMessageWindow", resourceCulture); + } + } + /// /// 查找类似 点击打开自定义非客户端区域窗口 的本地化字符串。 /// @@ -789,6 +807,24 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 进度按钮 的本地化字符串。 + /// + public static string ProgressButton { + get { + return ResourceManager.GetString("ProgressButton", resourceCulture); + } + } + + /// + /// 查找类似 按住说话 的本地化字符串。 + /// + public static string PushToTalk { + get { + return ResourceManager.GetString("PushToTalk", resourceCulture); + } + } + /// /// 查找类似 QQ群 的本地化字符串。 /// @@ -879,6 +915,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 秒 的本地化字符串。 + /// + public static string Second { + get { + return ResourceManager.GetString("Second", resourceCulture); + } + } + /// /// 查找类似 选中 的本地化字符串。 /// @@ -1077,6 +1122,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 穿梭框 的本地化字符串。 + /// + public static string Transfer { + get { + return ResourceManager.GetString("Transfer", resourceCulture); + } + } + /// /// 查找类似 树视图 的本地化字符串。 /// @@ -1104,6 +1158,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 上传;上传中 的本地化字符串。 + /// + public static string UploadStr { + get { + return ResourceManager.GetString("UploadStr", resourceCulture); + } + } + /// /// 查找类似 警告 的本地化字符串。 /// diff --git a/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.en.resx b/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.en.resx index 3db23d8b..966dc242 100644 --- a/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.en.resx +++ b/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.en.resx @@ -474,4 +474,25 @@ MessageBox - + + ProgressButton + + + Upload;Uploading + + + open custom message window + + + Transfer + + + ChatBubble + + + Push to talk + + + Sec + + \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.resx b/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.resx index 37ee53dc..88e899a7 100644 --- a/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.resx +++ b/Net40/HandyControlDemo_Net40/Properties/Langs/Lang.resx @@ -474,4 +474,25 @@ 消息框 - + + 进度按钮 + + + 上传;上传中 + + + 点击打开自定义消息窗口 + + + 穿梭框 + + + 对话气泡 + + + 按住说话 + + + 秒 + + \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/Resources/Img/Chat/chat_back1.jpg b/Net40/HandyControlDemo_Net40/Resources/Img/Chat/chat_back1.jpg new file mode 100644 index 00000000..929b4d63 Binary files /dev/null and b/Net40/HandyControlDemo_Net40/Resources/Img/Chat/chat_back1.jpg differ diff --git a/Net40/HandyControlDemo_Net40/Resources/Img/Chat/chat_back2.jpg b/Net40/HandyControlDemo_Net40/Resources/Img/Chat/chat_back2.jpg new file mode 100644 index 00000000..c0938954 Binary files /dev/null and b/Net40/HandyControlDemo_Net40/Resources/Img/Chat/chat_back2.jpg differ diff --git a/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/Bubble_16xLG.png b/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/Bubble_16xLG.png new file mode 100644 index 00000000..c73fba37 Binary files /dev/null and b/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/Bubble_16xLG.png differ diff --git a/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/ProgressButton_16x.png b/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/ProgressButton_16x.png new file mode 100644 index 00000000..ad7026ac Binary files /dev/null and b/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/ProgressButton_16x.png differ diff --git a/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/Transfer_16x.png b/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/Transfer_16x.png new file mode 100644 index 00000000..f7c9dac1 Binary files /dev/null and b/Net40/HandyControlDemo_Net40/Resources/Img/LeftMainContent/Transfer_16x.png differ diff --git a/Net40/HandyControlDemo_Net40/Resources/Themes/Basic/Geometries.xaml b/Net40/HandyControlDemo_Net40/Resources/Themes/Basic/Geometries.xaml index de1ea0c5..a746ad39 100644 --- a/Net40/HandyControlDemo_Net40/Resources/Themes/Basic/Geometries.xaml +++ b/Net40/HandyControlDemo_Net40/Resources/Themes/Basic/Geometries.xaml @@ -9,6 +9,8 @@ M449.722947 199.412211H706.021053c130.967579 0 237.136842 106.169263 237.136842 237.136842v256.298105c0 130.967579-106.169263 237.136842-237.136842 237.136842H449.722947c-130.965895 0-237.136842-106.169263-237.136842-237.136842V436.549053c0-130.967579 106.170947-237.136842 237.136842-237.136842z m-201.205894-21.557895c0-64.299789-70.085053-104.704-125.850948-72.55579s-55.764211 112.96 0 145.111579 125.850947-8.257684 125.850948-72.555789z m239.528421 234.74021c0-68.003368-74.088421-110.736842-133.037474-76.734315s-58.950737 119.467789 0 153.470315 133.039158-8.730947 133.039158-76.736zM835.368421 692.847158c0-117.596632-128.154947-191.494737-230.123789-132.695579s-101.970526 206.593684 0 265.391158S835.368421 810.443789 835.368421 692.847158z M430.079734 481.464543c45.196365 45.596478 118.486578 45.596478 163.68499 0l360.684736-324.939627c0.547469 3.751441 1.13894 7.490601 1.13894 11.401678l0 404.753417 0 116.754121c0 42.995233-34.547841 77.838809-77.145008 77.838809L145.397996 767.272941c-42.597167 0-77.145008-34.844599-77.145008-77.838809L68.252988 494.839155 68.252988 167.926594c0-3.911076 0.593518-7.65126 1.139963-11.401678L430.079734 481.464543zM910.960992 74.226538 562.044278 387.28558c-38.470173 38.811957-62.276369 38.811957-100.770078 0L112.538611 74.408687c10.011005-4.789073 21.069875-7.673773 32.859385-7.673773l733.044372 0C890.095779 66.735937 901.065622 69.539796 910.960992 74.226538z M260.8 645H160V0h100.8v645zM461.8 152.2h-100.8V1024h100.8V152.2z m201.2 0h-100.8V1024h100.8V152.2zM864 152h-100.8v494H864V152z + M736 224H288a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V288a64 64 0 0 0-64-64z m-416 160a64 64 0 1 1 128.032 0.032A64 64 0 0 1 320 384z m416 320a32 32 0 0 1-32 32H384a32 32 0 0 1-32-32l96-160c26.432-2.048 68.128 6.016 128 64l128-224a32 32 0 0 1 32 32v288z + M19.692308 512A25 25 0 1 1 19.692308 531.692308ZM512 303.027832C512 286.548884 524.86564 273.174666 540.717948 273.174666L598.153846 273.174666C614.006154 273.174666 626.871794 286.548884 626.871794 303.027832L626.871794 362.734167C626.871794 379.213115 614.006154 392.587333 598.153846 392.587333L540.717948 392.587333C524.86564 392.587333 512 379.213115 512 362.734167L512 303.027832 512 303.027832ZM512 482.146834 512 541.853166C512 558.332115 499.13436 571.706335 483.282052 571.706335L425.846154 571.706335C409.993846 571.706335 397.128206 558.332115 397.128206 541.853166L397.128206 482.146834C397.128206 465.667885 409.993846 452.293665 425.846154 452.293665L483.282052 452.293665C499.13436 452.293665 512 465.667885 512 482.146834L512 482.146834ZM339.692308 303.027832C339.692308 286.548884 352.557948 273.174666 368.410256 273.174666L425.846154 273.174666C441.698462 273.174666 454.564102 286.548884 454.564102 303.027832L454.564102 362.734167C454.564102 379.213115 441.698462 392.587333 425.846154 392.587333L368.410256 392.587333C352.557948 392.587333 339.692308 379.213115 339.692308 362.734167L339.692308 303.027832 339.692308 303.027832ZM167.384615 303.027832C167.384615 286.548884 180.250256 273.174666 196.102564 273.174666L253.538462 273.174666C269.390769 273.174666 282.25641 286.548884 282.25641 303.027832L282.25641 362.734167C282.25641 379.213115 269.390769 392.587333 253.538462 392.587333L196.102564 392.587333C180.250256 392.587333 167.384615 379.213115 167.384615 362.734167L167.384615 303.027832 167.384615 303.027832ZM282.25641 720.972168C282.25641 737.451116 269.390769 750.825334 253.538462 750.825334L196.102564 750.825334C180.250256 750.825334 167.384615 737.451116 167.384615 720.972168L167.384615 661.265833C167.384615 644.786885 180.250256 631.412667 196.102564 631.412667L253.538462 631.412667C269.390769 631.412667 282.25641 644.786885 282.25641 661.265833L282.25641 720.972168 282.25641 720.972168ZM310.97436 571.706335 253.538462 571.706335C237.686154 571.706335 224.820513 558.332115 224.820513 541.853166L224.820513 482.146834C224.820513 465.667885 237.686154 452.293665 253.538462 452.293665L310.97436 452.293665C326.826667 452.293665 339.692308 465.667885 339.692308 482.146834L339.692308 541.853166C339.692308 558.332115 326.826667 571.706335 310.97436 571.706335L310.97436 571.706335ZM569.435898 720.972168C569.435898 737.451116 556.570256 750.825334 540.717948 750.825334L368.410256 750.825334C352.557948 750.825334 339.692308 737.451116 339.692308 720.972168L339.692308 661.265833C339.692308 644.786885 352.557948 631.412667 368.410256 631.412667L540.717948 631.412667C556.570256 631.412667 569.435898 644.786885 569.435898 661.265833L569.435898 720.972168 569.435898 720.972168ZM569.435898 541.853166 569.435898 482.146834C569.435898 465.667885 582.301538 452.293665 598.153846 452.293665L655.589744 452.293665C671.442052 452.293665 684.307692 465.667885 684.307692 482.146834L684.307692 541.853166C684.307692 558.332115 671.442052 571.706335 655.589744 571.706335L598.153846 571.706335C582.301538 571.706335 569.435898 558.332115 569.435898 541.853166L569.435898 541.853166ZM856.615385 720.972168C856.615385 737.451116 843.749744 750.825334 827.897437 750.825334L655.589744 750.825334C639.737437 750.825334 626.871794 737.451116 626.871794 720.972168L626.871794 661.265833C626.871794 644.786885 639.737437 631.412667 655.589744 631.412667L713.02564 631.412667C728.877948 631.412667 741.74359 618.038449 741.74359 601.559501L741.74359 482.146834C741.74359 465.667885 754.609231 452.293665 770.461538 452.293665L827.897437 452.293665C843.749744 452.293665 856.615385 465.667885 856.615385 482.146834L856.615385 720.972168 856.615385 720.972168ZM856.615385 362.734167C856.615385 379.213115 843.749744 392.587333 827.897437 392.587333L713.02564 392.587333C697.173333 392.587333 684.307692 379.213115 684.307692 362.734167L684.307692 303.027832C684.307692 286.548884 697.173333 273.174666 713.02564 273.174666L827.897437 273.174666C843.749744 273.174666 856.615385 286.548884 856.615385 303.027832L856.615385 362.734167 856.615385 362.734167Z M890.2 208.2c-91.8-91.9-242.1-91.9-334 0L544.4 220c-18.2 18.2-47.6 18.2-65.8 0l-11.8-11.8c-91.9-91.9-242.1-91.9-334 0C41 300 24.7 533.9 203.6 722.1 304 827.8 412.4 882.3 470 905.9c26.6 10.9 56.5 10.9 83 0 57.6-23.6 166-78.1 266.4-183.8 178.9-188.2 162.6-422 70.8-513.9z M512 0C229.234472 0 0 229.226146 0 512 0 794.765528 229.234472 1024 512 1024S1024 794.765528 1024 512C1024 229.226146 794.765528 0 512 0zM228.776585 836.066862c-63.163317 0-114.371642-51.208325-114.371642-114.371642S165.613268 607.323577 228.776585 607.323577s114.371642 51.208325 114.371643 114.371643c0 63.171642-51.208325 114.371642-114.371643 114.371642z m420.555968-89.612488a391.867317 391.867317 0 0 1-1.989724 16.975089c-7.259577 30.203837-33.950179 52.898341-66.376845 52.898342-38.104455 0-68.990959-34.158309-68.99096-72.204488 0-5.877593 0.81587-11.463805 2.206179-16.775284-1.756618-131.096976-103.981789-237.867707-233.205593-246.883903l-6.343805-0.740943-1.015675-0.041626c-5.453008-0.216455-10.930992-0.732618-16.142569-2.331057a67.958634 67.958634 0 0 1-47.91987-65.078114c0-37.604943 30.245463-68.091837 67.550699-68.091837 0.299707 0 0.591089 0.041626 0.890797 0.049951l0.124878-0.049951c205.707447 2.139577 371.836878 169.484488 371.836878 375.699772 0 7.717463-0.341333 15.34335-0.824195 22.94426 0.066602 1.207154 0.19148 2.397659 0.199805 3.629789z m254.085203-63.329821c-10.856065 45.172553-25.80813 104.114992-74.310764 104.114992-56.994341 0-48.236228-66.085463-48.236228-122.996553 0-8.791415 1.223805-17.149919 3.296781-25.100488-2.639089-196.108488-169.834146-387.812943-363.137041-401.291447l-35.806699-5.827642c-42.117203-7.492683-111.715902-3.255154-111.715903-49.193626 0-56.253398 50.234276-81.861724 106.038114-81.861724 0.449561 0 0.882472 0.058276 1.332033 0.066602l0.183154-0.066602c307.724488 3.180228 526.252748 208.546341 526.252748 517.028423a538.474146 538.474146 0 0 1-1.23213 34.316488c0.108228 1.806569 0.291382 3.596488 0.308033 5.428032a542.72 542.72 0 0 1-2.972098 25.383545z M827.904 541.184a278.592 278.592 0 0 0 0-58.368l73.728-58.368c15.872-13.056 20.224-35.584 9.728-53.504l-78.592-137.728c-9.984-17.408-31.232-25.856-51.712-18.176l-86.528 35.072c-15.872-11.52-32.512-21.248-49.664-29.184l-12.8-92.928c-3.072-20.224-20.736-35.584-41.216-35.584h-157.44c-20.736 0-38.144 14.848-41.216 35.84L378.88 221.44c-17.152 7.936-33.792 17.92-49.664 29.184L242.688 215.296c-18.688-7.168-41.216 0.768-51.2 18.176L112.64 371.2c-10.24 17.92-6.144 40.448 10.24 53.76l73.472 58.112c-1.024 9.472-1.536 19.2-1.536 29.184 0 9.728 0.512 19.456 1.536 29.184l-73.984 58.368c-15.872 13.056-19.968 35.584-9.728 53.248l78.848 137.728c9.984 17.408 32 25.856 51.456 17.92l86.528-35.072c15.872 11.52 32.512 21.248 49.664 29.184l13.056 93.696c3.328 20.48 20.48 35.328 41.216 35.328h157.44c20.48 0 38.144-15.36 41.216-35.84l13.056-93.184c17.152-7.936 33.792-17.664 49.664-29.184l86.784 35.328c4.864 1.792 9.984 2.816 15.104 2.816 14.848 0 28.672-7.936 36.096-20.992l78.592-137.728c10.24-17.664 6.4-40.192-9.984-53.76l-73.472-58.112z m-25.344 231.168l-99.584-40.448c-7.424-3.072-15.872-1.792-22.272 3.072-19.712 15.36-40.704 27.648-62.464 36.608-7.424 3.072-12.544 9.728-13.568 17.664l-14.592 104.96-155.392 2.304-15.104-107.264c-1.024-7.936-6.4-14.592-13.568-17.664-21.76-8.96-42.752-21.504-62.464-36.608-4.096-3.072-8.96-4.608-13.824-4.608-2.816 0-5.888 0.512-8.448 1.536l-96.256 41.472-80.896-137.216 84.48-66.816c6.144-4.864 9.472-12.8 8.448-20.48-1.536-12.032-2.56-24.32-2.56-36.608 0-12.288 1.024-24.576 2.56-36.608 1.024-7.936-2.048-15.616-8.448-20.48l-83.712-64 76.544-139.264 99.584 40.448c7.424 3.072 15.872 1.792 22.272-3.072 19.712-15.36 40.96-27.648 62.72-36.864 7.424-3.072 12.544-9.728 13.568-17.664l12.544-104.704 157.696-2.304 15.104 107.264c1.024 7.936 6.4 14.592 13.568 17.664 21.76 8.96 42.752 21.504 62.464 36.864 6.4 4.864 14.848 6.144 22.272 3.072l96.256-41.472 80.896 137.216-84.48 66.816c-6.144 4.864-9.472 12.544-8.448 20.48 1.536 12.032 2.56 24.32 2.56 36.608 0 12.288-1.024 24.576-2.56 36.608-1.024 7.936 2.304 15.616 8.448 20.48l83.712 63.744-77.056 139.264zM512 345.6c-91.136 0-165.12 74.752-165.12 166.4s73.984 166.4 165.12 166.4 165.12-74.752 165.12-166.4-73.984-166.4-165.12-166.4z m0 297.216c-71.168 0-129.28-58.624-129.28-130.816 0-72.192 58.112-130.816 129.28-130.816s129.28 58.624 129.28 130.816c0 72.192-57.856 130.816-129.28 130.816z diff --git a/Net40/HandyControlDemo_Net40/Resources/Themes/Styles/Style.xaml b/Net40/HandyControlDemo_Net40/Resources/Themes/Styles/Style.xaml index 11cd7a5e..7cbb1fad 100644 --- a/Net40/HandyControlDemo_Net40/Resources/Themes/Styles/Style.xaml +++ b/Net40/HandyControlDemo_Net40/Resources/Themes/Styles/Style.xaml @@ -1,7 +1,8 @@  + xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl" + xmlns:langs="clr-namespace:HandyControl.Properties.Langs;assembly=HandyControl"> @@ -90,4 +91,37 @@ + + \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/Service/DataService.cs b/Net40/HandyControlDemo_Net40/Service/DataService.cs index c3752620..94a9f81e 100644 --- a/Net40/HandyControlDemo_Net40/Service/DataService.cs +++ b/Net40/HandyControlDemo_Net40/Service/DataService.cs @@ -14,7 +14,7 @@ namespace HandyControlDemo.Service internal List GetDemoDataList() { var list = new List(); - for (var i = 1; i <= 6; i++) + for (var i = 1; i <= 20; i++) { var dataList = new List(); for (int j = 0; j < 3; j++) @@ -34,7 +34,7 @@ namespace HandyControlDemo.Service Name = $"Name{i}", Type = (DemoType)i, DataList = dataList, - ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i}.png", + ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i % 7}.png", Remark = new string(i.ToString()[0], 10) }; list.Add(model); diff --git a/Net40/HandyControlDemo_Net40/Tools/AssemblyHelper.cs b/Net40/HandyControlDemo_Net40/Tools/Helper/AssemblyHelper.cs similarity index 100% rename from Net40/HandyControlDemo_Net40/Tools/AssemblyHelper.cs rename to Net40/HandyControlDemo_Net40/Tools/Helper/AssemblyHelper.cs diff --git a/Net40/HandyControlDemo_Net40/Tools/CommonHelper.cs b/Net40/HandyControlDemo_Net40/Tools/Helper/CommonHelper.cs similarity index 100% rename from Net40/HandyControlDemo_Net40/Tools/CommonHelper.cs rename to Net40/HandyControlDemo_Net40/Tools/Helper/CommonHelper.cs diff --git a/Net40/HandyControlDemo_Net40/Tools/Helper/ExternDllHelper.cs b/Net40/HandyControlDemo_Net40/Tools/Helper/ExternDllHelper.cs new file mode 100644 index 00000000..a5d0e53d --- /dev/null +++ b/Net40/HandyControlDemo_Net40/Tools/Helper/ExternDllHelper.cs @@ -0,0 +1,12 @@ +using System.Runtime.InteropServices; + +namespace HandyControlDemo.Tools +{ + internal class ExternDllHelper + { + private const string Winmm = "winmm.dll"; + + [DllImport(Winmm, EntryPoint = "mciSendString", CharSet = CharSet.Auto)] + public static extern int MciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback); + } +} \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Basic/ChatBox.xaml b/Net40/HandyControlDemo_Net40/UserControl/Basic/ChatBox.xaml new file mode 100644 index 00000000..590fb7b0 --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Basic/ChatBox.xaml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Basic/ChatBox.xaml.cs b/Net40/HandyControlDemo_Net40/UserControl/Basic/ChatBox.xaml.cs new file mode 100644 index 00000000..7b80e71c --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Basic/ChatBox.xaml.cs @@ -0,0 +1,10 @@ +namespace HandyControlDemo.UserControl +{ + public partial class ChatBox + { + public ChatBox() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/ChatBubbleDemoCtl.xaml b/Net40/HandyControlDemo_Net40/UserControl/Controls/ChatBubbleDemoCtl.xaml new file mode 100644 index 00000000..6455b40c --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/ChatBubbleDemoCtl.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/ChatBubbleDemoCtl.xaml.cs b/Net40/HandyControlDemo_Net40/UserControl/Controls/ChatBubbleDemoCtl.xaml.cs new file mode 100644 index 00000000..b0b7efd6 --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/ChatBubbleDemoCtl.xaml.cs @@ -0,0 +1,10 @@ +namespace HandyControlDemo.UserControl +{ + public partial class ChatBubbleDemoCtl + { + public ChatBubbleDemoCtl() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/ProgressButtonDemoCtl.xaml b/Net40/HandyControlDemo_Net40/UserControl/Controls/ProgressButtonDemoCtl.xaml new file mode 100644 index 00000000..4b78b122 --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/ProgressButtonDemoCtl.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/ProgressButtonDemoCtl.xaml.cs b/Net40/HandyControlDemo_Net40/UserControl/Controls/ProgressButtonDemoCtl.xaml.cs new file mode 100644 index 00000000..f44f7110 --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/ProgressButtonDemoCtl.xaml.cs @@ -0,0 +1,65 @@ +using System; +using System.Windows; +using System.Windows.Threading; + +namespace HandyControlDemo.UserControl +{ + public partial class ProgressButtonDemoCtl + { + public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register( + "Progress", typeof(int), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(int))); + + public int Progress + { + get => (int) GetValue(ProgressProperty); + set => SetValue(ProgressProperty, value); + } + + public static readonly DependencyProperty IsUploadingProperty = DependencyProperty.Register( + "IsUploading", typeof(bool), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(bool))); + + public bool IsUploading + { + get => (bool) GetValue(IsUploadingProperty); + set => SetValue(IsUploadingProperty, value); + } + + private readonly DispatcherTimer _timer; + + public ProgressButtonDemoCtl() + { + InitializeComponent(); + + DataContext = this; + + _timer = new DispatcherTimer + { + Interval = TimeSpan.FromMilliseconds(200) + }; + _timer.Tick += Timer_Tick; + } + + private void Timer_Tick(object sender, EventArgs e) + { + Progress++; + if (Progress == 100) + { + Progress = 0; + _timer.Stop(); + IsUploading = false; + } + } + + private void ButtonProgress_OnClick(object sender, RoutedEventArgs e) + { + if (_timer.IsEnabled) + { + _timer.Stop(); + } + else + { + _timer.Start(); + } + } + } +} diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/TransferDemoCtl.xaml b/Net40/HandyControlDemo_Net40/UserControl/Controls/TransferDemoCtl.xaml new file mode 100644 index 00000000..92f96d9a --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/TransferDemoCtl.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/TransferDemoCtl.xaml.cs b/Net40/HandyControlDemo_Net40/UserControl/Controls/TransferDemoCtl.xaml.cs new file mode 100644 index 00000000..cce1f608 --- /dev/null +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/TransferDemoCtl.xaml.cs @@ -0,0 +1,10 @@ +namespace HandyControlDemo.UserControl +{ + public partial class TransferDemoCtl + { + public TransferDemoCtl() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/WaterfallPanelDemoCtl.xaml b/Net40/HandyControlDemo_Net40/UserControl/Controls/WaterfallPanelDemoCtl.xaml index 9a631afa..71fb7e00 100644 --- a/Net40/HandyControlDemo_Net40/UserControl/Controls/WaterfallPanelDemoCtl.xaml +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/WaterfallPanelDemoCtl.xaml @@ -5,7 +5,7 @@ xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs" xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl" Background="{DynamicResource RegionBrush}"> - + @@ -53,5 +53,5 @@ - - + + \ No newline at end of file diff --git a/Net40/HandyControlDemo_Net40/UserControl/Controls/WindowDemoCtl.xaml b/Net40/HandyControlDemo_Net40/UserControl/Controls/WindowDemoCtl.xaml index a79f0c29..52dc1d5f 100644 --- a/Net40/HandyControlDemo_Net40/UserControl/Controls/WindowDemoCtl.xaml +++ b/Net40/HandyControlDemo_Net40/UserControl/Controls/WindowDemoCtl.xaml @@ -12,6 +12,7 @@