init branch
This commit is contained in:
1 parent
931aefe414
commit
86c58476c6
17 files changed
+84
-9
No files matched your search
@@ -399,6 +399,9 @@
|
|||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PolygonHexagon_16x.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PolygonHexagon_16x.png">
|
||||||
<Link>Resources\Img\LeftMainContent\PolygonHexagon_16x.png</Link>
|
<Link>Resources\Img\LeftMainContent\PolygonHexagon_16x.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\HandyControl.png">
|
||||||
|
<Link>Resources\Img\LeftMainContent\HandyControl.png</Link>
|
||||||
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
||||||
<Link>Resources\Img\Dance.png</Link>
|
<Link>Resources\Img\Dance.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
|||||||
@@ -417,6 +417,9 @@
|
|||||||
<Generator>TextTemplatingFileGenerator</Generator>
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\HandyControl.png">
|
||||||
|
<Link>Resources\Img\LeftMainContent\HandyControl.png</Link>
|
||||||
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PolygonHexagon_16x.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PolygonHexagon_16x.png">
|
||||||
<Link>Resources\Img\LeftMainContent\PolygonHexagon_16x.png</Link>
|
<Link>Resources\Img\LeftMainContent\PolygonHexagon_16x.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
|||||||
@@ -480,6 +480,9 @@
|
|||||||
<Generator>TextTemplatingFileGenerator</Generator>
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\HandyControl.png">
|
||||||
|
<Link>Resources\Img\LeftMainContent\HandyControl.png</Link>
|
||||||
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PolygonHexagon_16x.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PolygonHexagon_16x.png">
|
||||||
<Link>Resources\Img\LeftMainContent\PolygonHexagon_16x.png</Link>
|
<Link>Resources\Img\LeftMainContent\PolygonHexagon_16x.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
|||||||
@@ -110,6 +110,8 @@
|
|||||||
|
|
||||||
public static readonly string HoneycombPanelDemoCtl = nameof(HoneycombPanelDemoCtl);
|
public static readonly string HoneycombPanelDemoCtl = nameof(HoneycombPanelDemoCtl);
|
||||||
|
|
||||||
|
public static readonly string SpriteDemoCtl = nameof(SpriteDemoCtl);
|
||||||
|
|
||||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||||
|
|
||||||
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ var controlList = new List<string>
|
|||||||
"MagnifierDemoCtl",
|
"MagnifierDemoCtl",
|
||||||
"ImageBlockDemoCtl",
|
"ImageBlockDemoCtl",
|
||||||
"RunningBlockDemoCtl",
|
"RunningBlockDemoCtl",
|
||||||
"HoneycombPanelDemoCtl"
|
"HoneycombPanelDemoCtl",
|
||||||
|
"SpriteDemoCtl"
|
||||||
};
|
};
|
||||||
var styleList = new List<string>
|
var styleList = new List<string>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -177,6 +177,9 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\SideMenuDemoCtl.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\SideMenuDemoCtl.xaml.cs">
|
||||||
<DependentUpon>SideMenuDemoCtl.xaml</DependentUpon>
|
<DependentUpon>SideMenuDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\SpriteDemoCtl.xaml.cs">
|
||||||
|
<DependentUpon>SpriteDemoCtl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\StepBarDemoCtl.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\StepBarDemoCtl.xaml.cs">
|
||||||
<DependentUpon>StepBarDemoCtl.xaml</DependentUpon>
|
<DependentUpon>StepBarDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -596,6 +599,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\SpriteDemoCtl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\StepBarDemoCtl.xaml">
|
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\StepBarDemoCtl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -1365,6 +1365,15 @@ namespace HandyControlDemo.Properties.Langs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 精灵 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string Sprite {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Sprite", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 步骤 的本地化字符串。
|
/// 查找类似 步骤 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -645,4 +645,7 @@
|
|||||||
<data name="RemoveItem" xml:space="preserve">
|
<data name="RemoveItem" xml:space="preserve">
|
||||||
<value>Remove an item</value>
|
<value>Remove an item</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Sprite" xml:space="preserve">
|
||||||
|
<value>Sprite</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -645,4 +645,7 @@
|
|||||||
<data name="RemoveItem" xml:space="preserve">
|
<data name="RemoveItem" xml:space="preserve">
|
||||||
<value>删除项</value>
|
<value>删除项</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Sprite" xml:space="preserve">
|
||||||
|
<value>精灵</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,7 @@
|
|||||||
|
<UserControl x:Class="HandyControlDemo.UserControl.SpriteDemoCtl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
|
||||||
|
Background="{DynamicResource RegionBrush}">
|
||||||
|
<userControl:UnderConstruction/>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace HandyControlDemo.UserControl
|
||||||
|
{
|
||||||
|
public partial class SpriteDemoCtl
|
||||||
|
{
|
||||||
|
public SpriteDemoCtl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -330,7 +330,7 @@
|
|||||||
<Image Source="../../Resources/Img/LeftMainContent/Dynamic_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/Dynamic_16x.png"/>
|
||||||
</hc:EdgeElement.LeftContent>
|
</hc:EdgeElement.LeftContent>
|
||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.CardDemoCtl}" Content="{x:Static langs:Lang.Card}">
|
<ListBoxItem Tag="{x:Static data:MessageToken.CardDemoCtl}" Content="{x:Static langs:Lang.Card}">
|
||||||
<hc:EdgeElement.LeftContent>
|
<hc:EdgeElement.LeftContent>
|
||||||
<Image Source="../../Resources/Img/LeftMainContent/VSO_Card_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/VSO_Card_16x.png"/>
|
||||||
</hc:EdgeElement.LeftContent>
|
</hc:EdgeElement.LeftContent>
|
||||||
@@ -445,6 +445,11 @@
|
|||||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||||
</hc:EdgeElement.LeftContent>
|
</hc:EdgeElement.LeftContent>
|
||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
|
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.SpriteDemoCtl}" Content="{x:Static langs:Lang.Sprite}">
|
||||||
|
<hc:EdgeElement.LeftContent>
|
||||||
|
<Image Source="../../Resources/Img/LeftMainContent/HandyControl.png"/>
|
||||||
|
</hc:EdgeElement.LeftContent>
|
||||||
|
</ListBoxItem>
|
||||||
<ListBoxItem Tag="{x:Static data:MessageToken.DialogDemoCtl}" Content="{x:Static langs:Lang.Dialog}">
|
<ListBoxItem Tag="{x:Static data:MessageToken.DialogDemoCtl}" Content="{x:Static langs:Lang.Dialog}">
|
||||||
<hc:EdgeElement.LeftContent>
|
<hc:EdgeElement.LeftContent>
|
||||||
<Image Source="../../Resources/Img/LeftMainContent/Dialog_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/Dialog_16x.png"/>
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace HandyControl.Controls
|
||||||
|
{
|
||||||
|
public class Sprite : System.Windows.Window
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,18 +35,28 @@ namespace HandyControl.Controls
|
|||||||
set => SetValue(OffsetAngleProperty, value);
|
set => SetValue(OffsetAngleProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once RedundantAssignment
|
|
||||||
protected override Size MeasureOverride(Size availableSize)
|
protected override Size MeasureOverride(Size availableSize)
|
||||||
{
|
{
|
||||||
if (Children.Count == 0) return new Size(Diameter, Diameter);
|
if (Children.Count == 0) return new Size(Diameter, Diameter);
|
||||||
|
|
||||||
availableSize = new Size(Diameter, Diameter);
|
var newSize = new Size(Diameter, Diameter);
|
||||||
|
|
||||||
|
foreach (UIElement element in Children)
|
||||||
|
{
|
||||||
|
element.Measure(newSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
return newSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Size ArrangeOverride(Size finalSize)
|
||||||
|
{
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var perDeg = 360.0 / Children.Count;
|
var perDeg = 360.0 / Children.Count;
|
||||||
var radius = Diameter / 2;
|
var radius = Diameter / 2;
|
||||||
|
|
||||||
foreach (UIElement element in Children)
|
foreach (UIElement element in Children)
|
||||||
{
|
{
|
||||||
element.Measure(availableSize);
|
|
||||||
var centerX = element.DesiredSize.Width / 2.0;
|
var centerX = element.DesiredSize.Width / 2.0;
|
||||||
var centerY = element.DesiredSize.Height / 2.0;
|
var centerY = element.DesiredSize.Height / 2.0;
|
||||||
var angle = perDeg * i++ + OffsetAngle;
|
var angle = perDeg * i++ + OffsetAngle;
|
||||||
@@ -60,11 +70,12 @@ namespace HandyControl.Controls
|
|||||||
var r = Math.PI * angle / 180.0;
|
var r = Math.PI * angle / 180.0;
|
||||||
var x = radius * Math.Cos(r);
|
var x = radius * Math.Cos(r);
|
||||||
var y = radius * Math.Sin(r);
|
var y = radius * Math.Sin(r);
|
||||||
var rectX = x + availableSize.Width / 2 - centerX;
|
var rectX = x + finalSize.Width / 2 - centerX;
|
||||||
var rectY = y + availableSize.Height / 2 - centerY;
|
var rectY = y + finalSize.Height / 2 - centerY;
|
||||||
element.Arrange(new Rect(rectX, rectY, element.DesiredSize.Width, element.DesiredSize.Height));
|
element.Arrange(new Rect(rectX, rectY, element.DesiredSize.Width, element.DesiredSize.Height));
|
||||||
}
|
}
|
||||||
return availableSize;
|
|
||||||
|
return finalSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ namespace HandyControl.Controls
|
|||||||
child.Arrange(_stuffer.Move());
|
child.Arrange(_stuffer.Move());
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.ArrangeOverride(finalSize);
|
return finalSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class HoneycombStuffer
|
private class HoneycombStuffer
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Magnifier.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Magnifier.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ButtonGroup.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ButtonGroup.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Card.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Card.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Sprite.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ToggleBlock.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ToggleBlock.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\HoneycombPanel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\HoneycombPanel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeTrack.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeTrack.cs" />
|
||||||
|
|||||||
Reference in new issue
Block a user