From 05b122504c4fb8f0d41071a06ef2a9fe0a492d61 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Tue, 30 Oct 2018 23:29:38 +0800
Subject: [PATCH] add ContributorView
---
HandyControlDemo/Data/MessageToken.cs | 6 ++
HandyControlDemo/Data/MessageToken.tt | 6 ++
.../Data/Model/ContributorModel.cs | 12 +++
HandyControlDemo/HandyControlDemo.csproj | 26 ++++--
.../Properties/Langs/Lang.Designer.cs | 9 ++
.../Properties/Langs/Lang.en.resx | 3 +
HandyControlDemo/Properties/Langs/Lang.resx | 3 +
.../Resources/Themes/Basic/Brushes.xaml | 17 ++++
.../Resources/Themes/Basic/Geometries.xaml | 2 +
.../Resources/Themes/Styles/Button.xaml | 35 --------
.../Resources/Themes/Styles/ListBoxItem.xaml | 41 ----------
.../Resources/Themes/Styles/Style.xaml | 82 ++++++++++++++++++-
HandyControlDemo/Service/DataService.cs | 29 ++++++-
.../UserControl/Basic/Avatar.xaml | 22 +++++
.../UserControl/Basic/Avatar.xaml.cs | 44 ++++++++++
.../UserControl/Main/ContributorsView.xaml | 14 ++++
.../UserControl/Main/ContributorsView.xaml.cs | 11 +++
.../UserControl/Main/MainContent.xaml.cs | 10 ++-
.../UserControl/Main/NoUserContent.xaml | 5 ++
.../UserControl/Main/NoUserContent.xaml.cs | 9 ++
.../ViewModel/ContributorsViewModel.cs | 33 ++++++++
HandyControlDemo/ViewModel/MainViewModel.cs | 7 ++
.../ViewModel/NoUserContentViewModel.cs | 22 -----
.../ViewModel/ViewModelLocator.cs | 4 +-
24 files changed, 336 insertions(+), 116 deletions(-)
create mode 100644 HandyControlDemo/Data/Model/ContributorModel.cs
delete mode 100644 HandyControlDemo/Resources/Themes/Styles/Button.xaml
delete mode 100644 HandyControlDemo/Resources/Themes/Styles/ListBoxItem.xaml
create mode 100644 HandyControlDemo/UserControl/Basic/Avatar.xaml
create mode 100644 HandyControlDemo/UserControl/Basic/Avatar.xaml.cs
create mode 100644 HandyControlDemo/UserControl/Main/ContributorsView.xaml
create mode 100644 HandyControlDemo/UserControl/Main/ContributorsView.xaml.cs
create mode 100644 HandyControlDemo/ViewModel/ContributorsViewModel.cs
delete mode 100644 HandyControlDemo/ViewModel/NoUserContentViewModel.cs
diff --git a/HandyControlDemo/Data/MessageToken.cs b/HandyControlDemo/Data/MessageToken.cs
index e9048280..934400da 100644
--- a/HandyControlDemo/Data/MessageToken.cs
+++ b/HandyControlDemo/Data/MessageToken.cs
@@ -83,5 +83,11 @@
public static readonly string CustomNonClientAreaWindow = nameof(CustomNonClientAreaWindow);
public static readonly string LoadShowContent = nameof(LoadShowContent);
+
+ 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/HandyControlDemo/Data/MessageToken.tt b/HandyControlDemo/Data/MessageToken.tt
index 0726a29c..aeb89cc6 100644
--- a/HandyControlDemo/Data/MessageToken.tt
+++ b/HandyControlDemo/Data/MessageToken.tt
@@ -69,5 +69,11 @@ namespace HandyControlDemo.Data
<#}#>
public static readonly string LoadShowContent = nameof(LoadShowContent);
+
+ 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/HandyControlDemo/Data/Model/ContributorModel.cs b/HandyControlDemo/Data/Model/ContributorModel.cs
new file mode 100644
index 00000000..97ce9b6b
--- /dev/null
+++ b/HandyControlDemo/Data/Model/ContributorModel.cs
@@ -0,0 +1,12 @@
+// ReSharper disable once CheckNamespace
+namespace HandyControlDemo.Data
+{
+ public class ContributorModel
+ {
+ public string UserName { get; set; }
+
+ public string Link { get; set; }
+
+ public string AvatarUri { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/HandyControlDemo/HandyControlDemo.csproj b/HandyControlDemo/HandyControlDemo.csproj
index 6100f302..6605a20e 100644
--- a/HandyControlDemo/HandyControlDemo.csproj
+++ b/HandyControlDemo/HandyControlDemo.csproj
@@ -49,6 +49,7 @@
..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.Platform.dll
+
..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll
@@ -76,6 +77,7 @@
True
MessageToken.tt
+
True
@@ -90,6 +92,9 @@
+
+ Avatar.xaml
+
AnimationPathDemoCtl.xaml
@@ -135,6 +140,9 @@
WindowDemoCtl.xaml
+
+ ContributorsView.xaml
+
NoUserContent.xaml
@@ -214,10 +222,10 @@
TreeViewDemoCtl.xaml
+
-
@@ -266,18 +274,10 @@
Designer
MSBuild:Compile
-
- Designer
- MSBuild:Compile
-
Designer
MSBuild:Compile
-
- Designer
- MSBuild:Compile
-
Designer
MSBuild:Compile
@@ -290,6 +290,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -350,6 +354,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/HandyControlDemo/Properties/Langs/Lang.Designer.cs b/HandyControlDemo/Properties/Langs/Lang.Designer.cs
index 889f7a4d..09076982 100644
--- a/HandyControlDemo/Properties/Langs/Lang.Designer.cs
+++ b/HandyControlDemo/Properties/Langs/Lang.Designer.cs
@@ -258,6 +258,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 贡献者 的本地化字符串。
+ ///
+ public static string Contributors {
+ get {
+ return ResourceManager.GetString("Contributors", resourceCulture);
+ }
+ }
+
///
/// 查找类似 控件 的本地化字符串。
///
diff --git a/HandyControlDemo/Properties/Langs/Lang.en.resx b/HandyControlDemo/Properties/Langs/Lang.en.resx
index d1f753fc..db3e0e95 100644
--- a/HandyControlDemo/Properties/Langs/Lang.en.resx
+++ b/HandyControlDemo/Properties/Langs/Lang.en.resx
@@ -381,4 +381,7 @@
PreviewSlider
+
+ Contributors
+
\ No newline at end of file
diff --git a/HandyControlDemo/Properties/Langs/Lang.resx b/HandyControlDemo/Properties/Langs/Lang.resx
index 01f76e2c..fe2f5562 100644
--- a/HandyControlDemo/Properties/Langs/Lang.resx
+++ b/HandyControlDemo/Properties/Langs/Lang.resx
@@ -361,4 +361,7 @@
预览滑块
+
+ 贡献者
+
\ No newline at end of file
diff --git a/HandyControlDemo/Resources/Themes/Basic/Brushes.xaml b/HandyControlDemo/Resources/Themes/Basic/Brushes.xaml
index ce6aceef..3700bb0b 100644
--- a/HandyControlDemo/Resources/Themes/Basic/Brushes.xaml
+++ b/HandyControlDemo/Resources/Themes/Basic/Brushes.xaml
@@ -1,6 +1,10 @@
+
+
+
+
@@ -16,6 +20,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml b/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml
index 6b3f3906..bbc2b336 100644
--- a/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml
+++ b/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml
@@ -11,5 +11,7 @@
M260.8 645H160V0h100.8v645zM461.8 152.2h-100.8V1024h100.8V152.2z m201.2 0h-100.8V1024h100.8V152.2zM864 152h-100.8v494H864V152z
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
+ M657.486769 287.744c5.671385 0 11.264-5.671385 16.935385-5.671385l186.289231-124.140307c5.592615-5.592615 16.935385-16.935385 16.935384-28.199385V73.334154A74.673231 74.673231 0 0 0 804.233846 0H606.680615v220.002462c0 22.606769-16.935385 33.870769-39.463384 33.870769H454.262154c-22.528 0-39.463385-16.935385-39.463385-33.870769V5.671385H222.838154c-45.134769 0-79.005538 33.870769-79.005539 73.255384v56.477539c0 11.264 5.671385 22.528 16.935385 28.199384l186.289231 124.140308h16.935384C200.310154 349.735385 98.697846 507.746462 121.304615 693.878154c22.528 169.275077 169.353846 310.350769 344.221539 327.207384 237.095385 28.199385 440.32-152.339692 440.32-377.934769 0-158.011077-101.612308-299.008-248.359385-355.406769z m-146.747077 671.271385C335.793231 959.015385 189.046154 818.018462 189.046154 643.150769c0-174.867692 146.747077-310.350769 321.693538-310.350769 174.946462 0 321.693538 141.075692 321.693539 315.943385s-146.747077 310.350769-321.693539 310.350769zM670.798769 572.967385l-68.371692-11.185231a31.507692 31.507692 0 0 1-28.514462-16.777846l-28.514461-55.926154c-17.092923-27.963077-51.278769-27.963077-68.371692 0l-28.514462 55.926154a31.507692 31.507692 0 0 1-28.514462 16.777846l-68.371692 11.185231c-28.514462 5.592615-39.936 39.148308-17.092923 61.44l45.528615 39.227077c5.750154 11.185231 17.171692 22.370462 11.421539 33.555692l-11.421539 67.111384c-5.671385 27.963077 28.514462 50.333538 51.357539 33.555693l62.700308-27.963077a37.021538 37.021538 0 0 1 34.185846 0l62.700307 33.555692c28.514462 16.777846 57.028923-5.592615 51.27877-33.555692l-11.421539-67.111385c0-16.777846 5.750154-27.963077 11.421539-33.555692l51.278769-44.740923a38.596923 38.596923 0 0 0-22.843077-61.518769z
+ M1185.92 769.92h-1.28c0.576 0 0.96 0.64 1.536 0.704h0.384l-0.64-0.64z m0.256 0.704c-5.952 0.064-20.928 3.2-36.736 3.2-49.92 0-67.2-23.04-67.2-53.12V520.32h101.76c5.76 0 10.24-5.12 10.24-12.16v-108.8c0-5.76-5.12-10.88-10.24-10.88h-101.76V253.44c0-5.12-3.2-8.32-8.96-8.32h-138.24c-5.76 0-8.96 3.2-8.96 8.32v138.88s-69.76 17.28-74.24 17.92c-5.12 1.28-8.32 5.76-8.32 10.88v87.04c0 7.04 5.12 12.16 10.88 12.16h71.04v209.92c0 156.16 108.8 172.16 183.04 172.16 33.92 0 74.88-10.88 81.28-14.08 3.84-1.28 5.76-5.76 5.76-10.24v-96a11.328 11.328 0 0 0-9.344-11.52z m1516.544-140.8c0-115.84-46.72-131.2-96-126.08-38.4 2.56-69.12 21.76-69.12 21.76v225.28s31.36 21.76 78.08 23.04c65.92 1.92 87.04-21.76 87.04-144z m155.52-10.24c0 219.52-71.04 282.24-195.2 282.24-104.96 0-161.28-53.12-161.28-53.12s-2.56 29.44-5.76 33.28c-1.92 3.84-5.12 5.12-8.96 5.12h-94.72c-6.4 0-12.16-5.12-12.16-10.88l1.28-711.04c0-5.76 5.12-10.88 10.88-10.88h136.32c5.76 0 10.88 5.12 10.88 10.88v241.28s52.48-33.92 129.28-33.92l-0.64-1.28c76.8 0 190.08 28.8 190.08 248.32z m-558.08-231.04H2165.76c-7.04 0-10.88 5.12-10.88 12.16v348.16s-35.2 24.96-83.2 24.96-62.08-21.76-62.08-69.76V400c0-5.76-5.12-10.88-10.88-10.88h-136.96c-5.76 0-10.88 5.12-10.88 10.88v327.04c0 140.8 78.72 176 186.88 176 88.96 0 161.28-49.28 161.28-49.28s3.2 24.96 5.12 28.8c1.28 3.2 5.76 5.76 10.24 5.76h85.76c7.04 0 10.88-5.12 10.88-10.88l1.28-478.08c0-5.76-5.12-10.88-12.16-10.88z m-1516.8-0.64h-136.32c-5.76 0-10.88 5.76-10.88 12.8v469.76c0 12.8 8.32 17.28 19.2 17.28h122.88c12.8 0 16-5.76 16-17.28V398.72c0-5.76-5.12-10.88-10.88-10.88z m-67.2-216.32c-49.28 0-88.32 39.04-88.32 88.32 0 49.28 39.04 88.32 88.32 88.32 48 0 87.04-39.04 87.04-88.32 0-49.28-39.04-88.32-87.04-88.32z m1055.36-16h-135.04c-5.76 0-10.88 5.12-10.88 10.88v261.76h-211.84V166.4c0-5.76-5.12-10.88-10.88-10.88h-136.32c-5.76 0-10.88 5.12-10.88 10.88v711.04c0 5.76 5.76 10.88 10.88 10.88h136.32c5.76 0 10.88-5.12 10.88-10.88V573.44h211.84l-1.28 304c0 5.76 5.12 10.88 10.88 10.88h136.32c5.76 0 10.88-5.12 10.88-10.88V166.4c0-5.76-5.12-10.88-10.88-10.88zM563.84 470.4v367.36c0 2.56-0.64 7.04-3.84 8.32 0 0-80 56.96-211.84 56.96-159.36 0-348.16-49.92-348.16-378.88S165.12 127.36 326.4 128c139.52 0 195.84 31.36 204.8 37.12 2.56 3.2 3.84 5.76 3.84 8.96L508.16 288c0 5.76-5.76 12.8-12.8 10.88-23.04-7.04-57.6-21.12-138.88-21.12-94.08 0-195.2 26.88-195.2 238.72s96 236.8 165.12 236.8c58.88 0 80-7.04 80-7.04v-147.2H312.32c-7.04 0-12.16-5.12-12.16-10.88V470.4c0-5.76 5.12-10.88 12.16-10.88h239.36c7.04 0 12.16 5.12 12.16 10.88z
\ No newline at end of file
diff --git a/HandyControlDemo/Resources/Themes/Styles/Button.xaml b/HandyControlDemo/Resources/Themes/Styles/Button.xaml
deleted file mode 100644
index 1f5de5d6..00000000
--- a/HandyControlDemo/Resources/Themes/Styles/Button.xaml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/HandyControlDemo/Resources/Themes/Styles/ListBoxItem.xaml b/HandyControlDemo/Resources/Themes/Styles/ListBoxItem.xaml
deleted file mode 100644
index 91811af6..00000000
--- a/HandyControlDemo/Resources/Themes/Styles/ListBoxItem.xaml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/HandyControlDemo/Resources/Themes/Styles/Style.xaml b/HandyControlDemo/Resources/Themes/Styles/Style.xaml
index 41d8490f..20a6b53c 100644
--- a/HandyControlDemo/Resources/Themes/Styles/Style.xaml
+++ b/HandyControlDemo/Resources/Themes/Styles/Style.xaml
@@ -1,8 +1,84 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HandyControlDemo/Service/DataService.cs b/HandyControlDemo/Service/DataService.cs
index 26147359..33324a2e 100644
--- a/HandyControlDemo/Service/DataService.cs
+++ b/HandyControlDemo/Service/DataService.cs
@@ -1,7 +1,11 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Globalization;
+using System.Linq;
+using System.Net;
using HandyControlDemo.Data;
using HandyControlDemo.Tools.Converter;
+using Newtonsoft.Json;
namespace HandyControlDemo.Service
{
@@ -50,5 +54,28 @@ namespace HandyControlDemo.Service
return list;
}
+
+ public List GetContributorDataList()
+ {
+ var client = new WebClient();
+ client.Headers.Add("User-Agent", "request");
+ var list = new List();
+ try
+ {
+ var json = client.DownloadString(new Uri("https://api.github.com/repos/nabian/handycontrol/contributors"));
+ var objList = JsonConvert.DeserializeObject>(json);
+ list.AddRange(objList.Select(item => new ContributorModel
+ {
+ UserName = item.login,
+ AvatarUri = item.avatar_url,
+ Link = item.html_url
+ }));
+ }
+ catch
+ {
+ // ignored
+ }
+ return list;
+ }
}
}
\ No newline at end of file
diff --git a/HandyControlDemo/UserControl/Basic/Avatar.xaml b/HandyControlDemo/UserControl/Basic/Avatar.xaml
new file mode 100644
index 00000000..ba26d220
--- /dev/null
+++ b/HandyControlDemo/UserControl/Basic/Avatar.xaml
@@ -0,0 +1,22 @@
+
+
+
diff --git a/HandyControlDemo/UserControl/Basic/Avatar.xaml.cs b/HandyControlDemo/UserControl/Basic/Avatar.xaml.cs
new file mode 100644
index 00000000..68510040
--- /dev/null
+++ b/HandyControlDemo/UserControl/Basic/Avatar.xaml.cs
@@ -0,0 +1,44 @@
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Media.Imaging;
+
+// ReSharper disable once CheckNamespace
+namespace HandyControlDemo.UserControl
+{
+ public partial class Avatar
+ {
+ public Avatar()
+ {
+ InitializeComponent();
+ }
+
+ public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
+ "Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
+
+ public BitmapFrame Source
+ {
+ get => (BitmapFrame) GetValue(SourceProperty);
+ set => SetValue(SourceProperty, value);
+ }
+
+ public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
+ "UserName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
+
+ public string UserName
+ {
+ get => (string) GetValue(UserNameProperty);
+ set => SetValue(UserNameProperty, value);
+ }
+
+ public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
+ "Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
+
+ public string Link
+ {
+ get => (string) GetValue(LinkProperty);
+ set => SetValue(LinkProperty, value);
+ }
+
+ private void ButtonAvatar_OnClick(object sender, RoutedEventArgs e) => Process.Start(Link);
+ }
+}
\ No newline at end of file
diff --git a/HandyControlDemo/UserControl/Main/ContributorsView.xaml b/HandyControlDemo/UserControl/Main/ContributorsView.xaml
new file mode 100644
index 00000000..198f0dfe
--- /dev/null
+++ b/HandyControlDemo/UserControl/Main/ContributorsView.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/HandyControlDemo/UserControl/Main/ContributorsView.xaml.cs b/HandyControlDemo/UserControl/Main/ContributorsView.xaml.cs
new file mode 100644
index 00000000..d4d825b9
--- /dev/null
+++ b/HandyControlDemo/UserControl/Main/ContributorsView.xaml.cs
@@ -0,0 +1,11 @@
+// ReSharper disable once CheckNamespace
+namespace HandyControlDemo.UserControl
+{
+ public partial class ContributorsView
+ {
+ public ContributorsView()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/HandyControlDemo/UserControl/Main/MainContent.xaml.cs b/HandyControlDemo/UserControl/Main/MainContent.xaml.cs
index 16fdb298..c83584a1 100644
--- a/HandyControlDemo/UserControl/Main/MainContent.xaml.cs
+++ b/HandyControlDemo/UserControl/Main/MainContent.xaml.cs
@@ -1,5 +1,7 @@
using System.Windows;
+using GalaSoft.MvvmLight.Messaging;
using HandyControl.Tools.Extension;
+using HandyControlDemo.Data;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
@@ -14,9 +16,11 @@ namespace HandyControlDemo.UserControl
public MainContent()
{
InitializeComponent();
+
+ Messenger.Default.Register(this, MessageToken.FullSwitch, FullSwitch);
}
- public void FullSwitch(bool isFull)
+ private void FullSwitch(bool isFull)
{
if (_isFull == isFull) return;
_isFull = isFull;
@@ -34,8 +38,8 @@ namespace HandyControlDemo.UserControl
BorderEffect.Show();
BorderTitle.Show();
GridMain.HorizontalAlignment = HorizontalAlignment.Center;
- GridMain.VerticalAlignment = VerticalAlignment.Top;
- GridMain.Margin = new Thickness(16, 0, 16, 16);
+ GridMain.VerticalAlignment = VerticalAlignment.Center;
+ GridMain.Margin = new Thickness(16);
PresenterMain.Margin = new Thickness(0, 0, 0, 10);
}
}
diff --git a/HandyControlDemo/UserControl/Main/NoUserContent.xaml b/HandyControlDemo/UserControl/Main/NoUserContent.xaml
index 77d8c4bb..dcf230ff 100644
--- a/HandyControlDemo/UserControl/Main/NoUserContent.xaml
+++ b/HandyControlDemo/UserControl/Main/NoUserContent.xaml
@@ -53,6 +53,11 @@
+
diff --git a/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs b/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs
index bd9a8d82..7ad310da 100644
--- a/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs
+++ b/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs
@@ -3,9 +3,11 @@ using System.Diagnostics;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
+using GalaSoft.MvvmLight.Messaging;
using HandyControl.Controls;
using HandyControl.Data.Enum;
using HandyControlDemo.Data;
+using HandyControlDemo.Tools;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
@@ -56,5 +58,12 @@ namespace HandyControlDemo.UserControl
Process.Start(tag);
}
}
+
+ private void MenuItemContributors_OnClick(object sender, RoutedEventArgs e)
+ {
+ Messenger.Default.Send