add ContributorView
This commit is contained in:
1 parent
ed47b6f852
commit
05b122504c
24 files changed
+336
-116
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@
|
||||
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -76,6 +77,7 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>MessageToken.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Data\Model\ContributorModel.cs" />
|
||||
<Compile Include="Data\Model\DemoDataModel.cs" />
|
||||
<Compile Include="Properties\Langs\Lang.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -90,6 +92,9 @@
|
||||
<Compile Include="Service\DataService.cs" />
|
||||
<Compile Include="Tools\AssemblyHelper.cs" />
|
||||
<Compile Include="Tools\Converter\StringRepeatConverter.cs" />
|
||||
<Compile Include="UserControl\Basic\Avatar.xaml.cs">
|
||||
<DependentUpon>Avatar.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
|
||||
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -135,6 +140,9 @@
|
||||
<Compile Include="UserControl\Controls\WindowDemoCtl.xaml.cs">
|
||||
<DependentUpon>WindowDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Main\ContributorsView.xaml.cs">
|
||||
<DependentUpon>ContributorsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Main\NoUserContent.xaml.cs">
|
||||
<DependentUpon>NoUserContent.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -214,10 +222,10 @@
|
||||
<DependentUpon>TreeViewDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModel\ComboBoxDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\ContributorsViewModel.cs" />
|
||||
<Compile Include="ViewModel\GrowlDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\ImageBrowserDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\MainViewModel.cs" />
|
||||
<Compile Include="ViewModel\NoUserContentViewModel.cs" />
|
||||
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||
<Compile Include="ViewModel\WindowDemoViewModel.cs" />
|
||||
<Compile Include="Window\CommonWindow.xaml.cs">
|
||||
@@ -266,18 +274,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Resources\Themes\Styles\Button.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Resources\Themes\Styles\Style.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Resources\Themes\Styles\ListBoxItem.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Resources\Themes\Styles\StyleDark.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -290,6 +290,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Basic\Avatar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Controls\AnimationPathDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -350,6 +354,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Main\ContributorsView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Main\NoUserContent.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -258,6 +258,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 贡献者 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Contributors {
|
||||
get {
|
||||
return ResourceManager.GetString("Contributors", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 控件 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -381,4 +381,7 @@
|
||||
<data name="PreviewSlider" xml:space="preserve">
|
||||
<value>PreviewSlider</value>
|
||||
</data>
|
||||
<data name="Contributors" xml:space="preserve">
|
||||
<value>Contributors</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -361,4 +361,7 @@
|
||||
<data name="PreviewSlider" xml:space="preserve">
|
||||
<value>预览滑块</value>
|
||||
</data>
|
||||
<data name="Contributors" xml:space="preserve">
|
||||
<value>贡献者</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,6 +1,10 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Geometries.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<DrawingBrush x:Key="MainContentForegroundDrawingBrush" RenderOptions.CachingHint="Cache" Viewport="0,0,16,16" ViewportUnits="Absolute" Stretch="None" TileMode="Tile">
|
||||
<DrawingBrush.Drawing>
|
||||
<DrawingGroup>
|
||||
@@ -16,6 +20,19 @@
|
||||
</DrawingBrush.Drawing>
|
||||
</DrawingBrush>
|
||||
|
||||
<DrawingBrush x:Key="GitHubDrawingBrush" RenderOptions.CachingHint="Cache" Viewport="0,0,200,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
|
||||
<DrawingBrush.Transform>
|
||||
<TransformGroup>
|
||||
<RotateTransform Angle="20"/>
|
||||
</TransformGroup>
|
||||
</DrawingBrush.Transform>
|
||||
<DrawingBrush.Drawing>
|
||||
<DrawingGroup>
|
||||
<GeometryDrawing Brush="{DynamicResource DarkMaskBrush}" Geometry="{StaticResource GitHubStrGeometry}"/>
|
||||
</DrawingGroup>
|
||||
</DrawingBrush.Drawing>
|
||||
</DrawingBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="MenuButtonBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="White" Offset="0"/>
|
||||
<GradientStop Color="#F2F2F2" Offset="1"/>
|
||||
|
||||
@@ -11,5 +11,7 @@
|
||||
<Geometry x:Key="GitterGeometry">M260.8 645H160V0h100.8v645zM461.8 152.2h-100.8V1024h100.8V152.2z m201.2 0h-100.8V1024h100.8V152.2zM864 152h-100.8v494H864V152z</Geometry>
|
||||
<Geometry x:Key="CnblogsGeometry">M512 0C229.234472 0 0 229.226146 0 512 0 794.765528 229.234472 1024 512 1024S1024 794.765528 1024 512C1024 229.226146 794.765528 0 512 0zM228.776585 836.066862c-63.163317 0-114.371642-51.208325-114.371642-114.371642S165.613268 607.323577 228.776585 607.323577s114.371642 51.208325 114.371643 114.371643c0 63.171642-51.208325 114.371642-114.371643 114.371642z m420.555968-89.612488a391.867317 391.867317 0 0 1-1.989724 16.975089c-7.259577 30.203837-33.950179 52.898341-66.376845 52.898342-38.104455 0-68.990959-34.158309-68.99096-72.204488 0-5.877593 0.81587-11.463805 2.206179-16.775284-1.756618-131.096976-103.981789-237.867707-233.205593-246.883903l-6.343805-0.740943-1.015675-0.041626c-5.453008-0.216455-10.930992-0.732618-16.142569-2.331057a67.958634 67.958634 0 0 1-47.91987-65.078114c0-37.604943 30.245463-68.091837 67.550699-68.091837 0.299707 0 0.591089 0.041626 0.890797 0.049951l0.124878-0.049951c205.707447 2.139577 371.836878 169.484488 371.836878 375.699772 0 7.717463-0.341333 15.34335-0.824195 22.94426 0.066602 1.207154 0.19148 2.397659 0.199805 3.629789z m254.085203-63.329821c-10.856065 45.172553-25.80813 104.114992-74.310764 104.114992-56.994341 0-48.236228-66.085463-48.236228-122.996553 0-8.791415 1.223805-17.149919 3.296781-25.100488-2.639089-196.108488-169.834146-387.812943-363.137041-401.291447l-35.806699-5.827642c-42.117203-7.492683-111.715902-3.255154-111.715903-49.193626 0-56.253398 50.234276-81.861724 106.038114-81.861724 0.449561 0 0.882472 0.058276 1.332033 0.066602l0.183154-0.066602c307.724488 3.180228 526.252748 208.546341 526.252748 517.028423a538.474146 538.474146 0 0 1-1.23213 34.316488c0.108228 1.806569 0.291382 3.596488 0.308033 5.428032a542.72 542.72 0 0 1-2.972098 25.383545z</Geometry>
|
||||
<Geometry x:Key="ConfigGeometry">M827.904 541.184a278.592 278.592 0 0 0 0-58.368l73.728-58.368c15.872-13.056 20.224-35.584 9.728-53.504l-78.592-137.728c-9.984-17.408-31.232-25.856-51.712-18.176l-86.528 35.072c-15.872-11.52-32.512-21.248-49.664-29.184l-12.8-92.928c-3.072-20.224-20.736-35.584-41.216-35.584h-157.44c-20.736 0-38.144 14.848-41.216 35.84L378.88 221.44c-17.152 7.936-33.792 17.92-49.664 29.184L242.688 215.296c-18.688-7.168-41.216 0.768-51.2 18.176L112.64 371.2c-10.24 17.92-6.144 40.448 10.24 53.76l73.472 58.112c-1.024 9.472-1.536 19.2-1.536 29.184 0 9.728 0.512 19.456 1.536 29.184l-73.984 58.368c-15.872 13.056-19.968 35.584-9.728 53.248l78.848 137.728c9.984 17.408 32 25.856 51.456 17.92l86.528-35.072c15.872 11.52 32.512 21.248 49.664 29.184l13.056 93.696c3.328 20.48 20.48 35.328 41.216 35.328h157.44c20.48 0 38.144-15.36 41.216-35.84l13.056-93.184c17.152-7.936 33.792-17.664 49.664-29.184l86.784 35.328c4.864 1.792 9.984 2.816 15.104 2.816 14.848 0 28.672-7.936 36.096-20.992l78.592-137.728c10.24-17.664 6.4-40.192-9.984-53.76l-73.472-58.112z m-25.344 231.168l-99.584-40.448c-7.424-3.072-15.872-1.792-22.272 3.072-19.712 15.36-40.704 27.648-62.464 36.608-7.424 3.072-12.544 9.728-13.568 17.664l-14.592 104.96-155.392 2.304-15.104-107.264c-1.024-7.936-6.4-14.592-13.568-17.664-21.76-8.96-42.752-21.504-62.464-36.608-4.096-3.072-8.96-4.608-13.824-4.608-2.816 0-5.888 0.512-8.448 1.536l-96.256 41.472-80.896-137.216 84.48-66.816c6.144-4.864 9.472-12.8 8.448-20.48-1.536-12.032-2.56-24.32-2.56-36.608 0-12.288 1.024-24.576 2.56-36.608 1.024-7.936-2.048-15.616-8.448-20.48l-83.712-64 76.544-139.264 99.584 40.448c7.424 3.072 15.872 1.792 22.272-3.072 19.712-15.36 40.96-27.648 62.72-36.864 7.424-3.072 12.544-9.728 13.568-17.664l12.544-104.704 157.696-2.304 15.104 107.264c1.024 7.936 6.4 14.592 13.568 17.664 21.76 8.96 42.752 21.504 62.464 36.864 6.4 4.864 14.848 6.144 22.272 3.072l96.256-41.472 80.896 137.216-84.48 66.816c-6.144 4.864-9.472 12.544-8.448 20.48 1.536 12.032 2.56 24.32 2.56 36.608 0 12.288-1.024 24.576-2.56 36.608-1.024 7.936 2.304 15.616 8.448 20.48l83.712 63.744-77.056 139.264zM512 345.6c-91.136 0-165.12 74.752-165.12 166.4s73.984 166.4 165.12 166.4 165.12-74.752 165.12-166.4-73.984-166.4-165.12-166.4z m0 297.216c-71.168 0-129.28-58.624-129.28-130.816 0-72.192 58.112-130.816 129.28-130.816s129.28 58.624 129.28 130.816c0 72.192-57.856 130.816-129.28 130.816z</Geometry>
|
||||
<Geometry x:Key="ContributorsGeometry">M657.486769 287.744c5.671385 0 11.264-5.671385 16.935385-5.671385l186.289231-124.140307c5.592615-5.592615 16.935385-16.935385 16.935384-28.199385V73.334154A74.673231 74.673231 0 0 0 804.233846 0H606.680615v220.002462c0 22.606769-16.935385 33.870769-39.463384 33.870769H454.262154c-22.528 0-39.463385-16.935385-39.463385-33.870769V5.671385H222.838154c-45.134769 0-79.005538 33.870769-79.005539 73.255384v56.477539c0 11.264 5.671385 22.528 16.935385 28.199384l186.289231 124.140308h16.935384C200.310154 349.735385 98.697846 507.746462 121.304615 693.878154c22.528 169.275077 169.353846 310.350769 344.221539 327.207384 237.095385 28.199385 440.32-152.339692 440.32-377.934769 0-158.011077-101.612308-299.008-248.359385-355.406769z m-146.747077 671.271385C335.793231 959.015385 189.046154 818.018462 189.046154 643.150769c0-174.867692 146.747077-310.350769 321.693538-310.350769 174.946462 0 321.693538 141.075692 321.693539 315.943385s-146.747077 310.350769-321.693539 310.350769zM670.798769 572.967385l-68.371692-11.185231a31.507692 31.507692 0 0 1-28.514462-16.777846l-28.514461-55.926154c-17.092923-27.963077-51.278769-27.963077-68.371692 0l-28.514462 55.926154a31.507692 31.507692 0 0 1-28.514462 16.777846l-68.371692 11.185231c-28.514462 5.592615-39.936 39.148308-17.092923 61.44l45.528615 39.227077c5.750154 11.185231 17.171692 22.370462 11.421539 33.555692l-11.421539 67.111384c-5.671385 27.963077 28.514462 50.333538 51.357539 33.555693l62.700308-27.963077a37.021538 37.021538 0 0 1 34.185846 0l62.700307 33.555692c28.514462 16.777846 57.028923-5.592615 51.27877-33.555692l-11.421539-67.111385c0-16.777846 5.750154-27.963077 11.421539-33.555692l51.278769-44.740923a38.596923 38.596923 0 0 0-22.843077-61.518769z</Geometry>
|
||||
<Geometry x:Key="GitHubStrGeometry">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</Geometry>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,35 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button">
|
||||
<Setter Property="UseLayoutRounding" Value="False"/>
|
||||
<Setter Property="Height" Value="77"/>
|
||||
<Setter Property="Width" Value="36.06"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06"/>
|
||||
<Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Opacity" Value=".9"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Opacity" Value=".6"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.4"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,41 +0,0 @@
|
||||
<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;assembly=HandyControl">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="ListBoxItemNew" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<Path VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="controls:EdgeElement.ShowEdgeContent" Value="true">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ContentControl Width="16" Height="16" Content="{Binding Path=(controls:EdgeElement.LeftContent),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter Margin="6,0,0,0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<Path VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,8 +1,84 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<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;assembly=HandyControl"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ListBoxItem.xaml"/>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button">
|
||||
<Setter Property="UseLayoutRounding" Value="False"/>
|
||||
<Setter Property="Height" Value="77"/>
|
||||
<Setter Property="Width" Value="36.06"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06"/>
|
||||
<Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Opacity" Value=".9"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Opacity" Value=".6"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.4"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ListBoxItemNew" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<Path VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="controls:EdgeElement.ShowEdgeContent" Value="true">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ContentControl Width="16" Height="16" Content="{Binding Path=(controls:EdgeElement.LeftContent),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter Margin="6,0,0,0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<Path VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate">
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<interactivity:FluidMoveBehavior AppliesTo="Children" Duration="0:0:.2">
|
||||
<interactivity:FluidMoveBehavior.EaseX>
|
||||
<PowerEase/>
|
||||
</interactivity:FluidMoveBehavior.EaseX>
|
||||
<interactivity:FluidMoveBehavior.EaseY>
|
||||
<PowerEase/>
|
||||
</interactivity:FluidMoveBehavior.EaseY>
|
||||
</interactivity:FluidMoveBehavior>
|
||||
</interactivity:Interaction.Behaviors>
|
||||
</WrapPanel>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -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<ContributorModel> GetContributorDataList()
|
||||
{
|
||||
var client = new WebClient();
|
||||
client.Headers.Add("User-Agent", "request");
|
||||
var list = new List<ContributorModel>();
|
||||
try
|
||||
{
|
||||
var json = client.DownloadString(new Uri("https://api.github.com/repos/nabian/handycontrol/contributors"));
|
||||
var objList = JsonConvert.DeserializeObject<List<dynamic>>(json);
|
||||
list.AddRange(objList.Select(item => new ContributorModel
|
||||
{
|
||||
UserName = item.login,
|
||||
AvatarUri = item.avatar_url,
|
||||
Link = item.html_url
|
||||
}));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.Avatar"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
Margin="16"
|
||||
Effect="{StaticResource EffectShadow5}"
|
||||
Cursor="Hand"
|
||||
mc:Ignorable="d">
|
||||
<Button Style="{StaticResource ButtonCustom}" Click="ButtonAvatar_OnClick">
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="{Binding Source,RelativeSource={RelativeSource FindAncestor,AncestorType=UserControl}}" Height="120" Width="120" Stretch="Uniform" Margin="10"/>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding UserName,RelativeSource={RelativeSource FindAncestor,AncestorType=UserControl}}"></TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.ContributorsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
|
||||
DataContext="{Binding ContributorsView,Source={StaticResource Locator}}"
|
||||
Background="{DynamicResource SecondaryRegionBrush}">
|
||||
<ListBox Background="{DynamicResource GitHubDrawingBrush}" ItemContainerStyle="{StaticResource ListBoxItemStyle}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<userControl:Avatar UserName="{Binding UserName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ContributorsView
|
||||
{
|
||||
public ContributorsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<bool>(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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,11 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Click="MenuItemContributors_OnClick" Foreground="White" Header="{x:Static langs:Lang.Contributors}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ContributorsGeometry}" Fill="#ef6c00"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
|
||||
|
||||
@@ -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<object>(null, MessageToken.ClearLeftSelected);
|
||||
Messenger.Default.Send(true, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.ContributorsView}"), MessageToken.LoadShowContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using GalaSoft.MvvmLight;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ContributorsViewModel : ViewModelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
private List<ContributorModel> _dataList;
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
public List<ContributorModel> DataList
|
||||
{
|
||||
get => _dataList;
|
||||
set => Set(ref _dataList, value);
|
||||
}
|
||||
|
||||
public ContributorsViewModel(DataService dataService)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
DataList = dataService.GetContributorDataList();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,12 @@ namespace HandyControlDemo.ViewModel
|
||||
public MainViewModel(DataService dataService)
|
||||
{
|
||||
Messenger.Default.Register<object>(this, MessageToken.LoadShowContent, obj => SubContent = obj);
|
||||
Messenger.Default.Register<object>(this, MessageToken.ClearLeftSelected, obj =>
|
||||
{
|
||||
if (_listBoxItemCurrent == null) return;
|
||||
_listBoxItemCurrent.IsSelected = false;
|
||||
_listBoxItemCurrent = null;
|
||||
});
|
||||
DataList = dataService.GetDemoDataList();
|
||||
}
|
||||
|
||||
@@ -99,6 +105,7 @@ namespace HandyControlDemo.ViewModel
|
||||
if (Equals(_listBoxItemCurrent, item)) return;
|
||||
_listBoxItemCurrent = item;
|
||||
ContentTitle = item.Content;
|
||||
Messenger.Default.Send(false, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{tag}"), MessageToken.LoadShowContent);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Windows.Media.Imaging;
|
||||
using GalaSoft.MvvmLight;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class NoUserContentViewModel : ViewModelBase
|
||||
{
|
||||
public NoUserContentViewModel()
|
||||
{
|
||||
NugetDownloadCount = 11111;
|
||||
}
|
||||
|
||||
private int _nugetDownloadCount;
|
||||
|
||||
public int NugetDownloadCount
|
||||
{
|
||||
get => _nugetDownloadCount;
|
||||
set => Set(ref _nugetDownloadCount, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ namespace HandyControlDemo.ViewModel
|
||||
SimpleIoc.Default.Register<ImageBrowserDemoViewModel>();
|
||||
SimpleIoc.Default.Register<ComboBoxDemoViewModel>();
|
||||
SimpleIoc.Default.Register<WindowDemoViewModel>();
|
||||
SimpleIoc.Default.Register<NoUserContentViewModel>();
|
||||
SimpleIoc.Default.Register<ContributorsViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||
@@ -37,7 +37,7 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public WindowDemoViewModel WindowDemo => ServiceLocator.Current.GetInstance<WindowDemoViewModel>();
|
||||
|
||||
public NoUserContentViewModel NoUserContent => ServiceLocator.Current.GetInstance<NoUserContentViewModel>();
|
||||
public ContributorsViewModel ContributorsView => ServiceLocator.Current.GetInstance<ContributorsViewModel>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user