86 files changed
+1249
-311
No files matched your search
@@ -350,9 +350,6 @@
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PaneLayout_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\PaneLayout_16x.png</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<StackPanel Name="ButtonPanel" WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
@@ -110,6 +110,7 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
|
||||
+16
-16
@@ -61,7 +61,7 @@ Global
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net48|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net48|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Core30|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Core30|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net40|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
|
||||
@@ -71,24 +71,24 @@ Global
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Core30|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net40|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Core30|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net40|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.Build.0 = Debug-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net48|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net48|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Core30|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Core30|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net40|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.ActiveCfg = Release-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.Build.0 = Release-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
||||
@@ -49,8 +49,8 @@ Global
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
|
||||
@@ -395,9 +395,6 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PaneLayout_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\PaneLayout_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||
</Resource>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel shell:WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<StackPanel Name="ButtonPanel" shell:WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
@@ -110,6 +110,7 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
|
||||
@@ -15,6 +15,29 @@
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net462|AnyCPU'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-Net47|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -38,6 +61,26 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net462|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net47|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -414,9 +457,6 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PaneLayout_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\PaneLayout_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||
</Resource>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -161,6 +162,7 @@
|
||||
<Link>Properties\Langs\Lang.resx</Link>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<StackPanel Name="ButtonPanel" WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
@@ -110,6 +110,7 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
|
||||
@@ -98,8 +98,6 @@
|
||||
|
||||
public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
|
||||
|
||||
public static readonly string RelativePanelDemoCtl = nameof(RelativePanelDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
||||
|
||||
@@ -51,8 +51,7 @@ var controlList = new List<string>
|
||||
"DialogDemoCtl",
|
||||
"SideMenuDemoCtl",
|
||||
"GridDemoCtl",
|
||||
"RangeSliderDemoCtl",
|
||||
"RelativePanelDemoCtl"
|
||||
"RangeSliderDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -816,6 +816,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 关 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Off {
|
||||
get {
|
||||
return ResourceManager.GetString("Off", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 确定 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -825,6 +834,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 开 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string On {
|
||||
get {
|
||||
return ResourceManager.GetString("On", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 点击打开背景模糊窗口 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -612,4 +612,10 @@
|
||||
<data name="RelativePanel" xml:space="preserve">
|
||||
<value>RelativePanel</value>
|
||||
</data>
|
||||
<data name="On" xml:space="preserve">
|
||||
<value>On</value>
|
||||
</data>
|
||||
<data name="Off" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -612,4 +612,10 @@
|
||||
<data name="RelativePanel" xml:space="preserve">
|
||||
<value>相对布局</value>
|
||||
</data>
|
||||
<data name="On" xml:space="preserve">
|
||||
<value>开</value>
|
||||
</data>
|
||||
<data name="Off" xml:space="preserve">
|
||||
<value>关</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 164 B |
@@ -19,7 +19,7 @@ namespace HandyControlDemo.Service
|
||||
for (var i = 1; i <= 20; i++)
|
||||
{
|
||||
var dataList = new List<DemoDataModel>();
|
||||
for (int j = 0; j < 3; j++)
|
||||
for (var j = 0; j < 3; j++)
|
||||
{
|
||||
dataList.Add(new DemoDataModel
|
||||
{
|
||||
|
||||
@@ -325,11 +325,6 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Panel_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.RelativePanelDemoCtl}" Content="{x:Static langs:Lang.RelativePanel}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/PaneLayout_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.CoverViewDemoCtl}" Content="{x:Static langs:Lang.CoverView}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/DetailDataView_16x.png"/>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0" Margin="0,16,0,0" IsEditable="True"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr1}" Style="{StaticResource ComboBoxExtend}" Margin="0,32,0,0" Text="{x:Static langs:Lang.ContentDemoStr}"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr2}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr2}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" hc:InfoElement.Symbol="*" Margin="0,16,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" IsEditable="True" SelectedIndex="0" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr1}" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0" Text="{x:Static langs:Lang.ContentDemoStr}"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" IsEditable="True" hc:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr2}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
|
||||
|
||||
@@ -104,6 +104,29 @@
|
||||
<ToggleButton IsEnabled="False" IsChecked="True" HorizontalAlignment="Center" Margin="5,9" Style="{StaticResource ToggleButtonSwitch}"/>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSwitch"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton BorderThickness="0" IsChecked="True" Margin="5" HorizontalAlignment="Center" Style="{StaticResource ToggleButtonFlip}">
|
||||
<hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource PrimaryBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.Off}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource DangerBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.On}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</ToggleButton>
|
||||
<ToggleButton BorderThickness="0" IsEnabled="False" IsChecked="True" Margin="5" HorizontalAlignment="Center" Style="{StaticResource ToggleButtonFlip}">
|
||||
<hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource PrimaryBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.Off}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource DangerBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.On}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonFlip"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</hc:ScrollViewer>
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
<hc:Window x:Class="HandyControlDemo.Window.AboutWindow"
|
||||
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:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
Title="{x:Static langs:Lang.About}"
|
||||
ShowTitle="True"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#262e2f"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="340"
|
||||
Height="220">
|
||||
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:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
Title="{x:Static langs:Lang.About}"
|
||||
ShowTitle="True"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#262e2f"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="340"
|
||||
Height="220">
|
||||
<hc:SimplePanel>
|
||||
<TextBlock Text="{x:Static hc:Lang.Cancel}" />
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,30,0,0">
|
||||
<TextBlock Text="HandyControl" FontSize="30" Foreground="{StaticResource PrimaryBrush}" VerticalAlignment="Top" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Version}" HorizontalAlignment="Center" Margin="0,10,0,0" Foreground="{StaticResource PrimaryBrush}"/>
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (show)
|
||||
{
|
||||
for (int i = 0; i < itemsCount; i++)
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
var row = (DataGridRow)generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
@@ -257,7 +257,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < itemsCount; i++)
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
var row = (DataGridRow)generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
var list = new List<bool>();
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
list.Add(false);
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
guids[i] = (Guid)ExternDllHelper.PtrToStructure((IntPtr)((long)buffer + size * i), typeof(Guid));
|
||||
}
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace HandyControl.Controls
|
||||
|
||||
public static readonly DependencyProperty DotCountProperty = DependencyProperty.Register(
|
||||
"DotCount", typeof(int), typeof(LoadingBase),
|
||||
new FrameworkPropertyMetadata(5, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
new FrameworkPropertyMetadata(ValueBoxes.Int5Box, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public static readonly DependencyProperty DotIntervalProperty = DependencyProperty.Register(
|
||||
"DotInterval", typeof(double), typeof(LoadingBase),
|
||||
new FrameworkPropertyMetadata(10.0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
new FrameworkPropertyMetadata(ValueBoxes.Double10Box, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public static readonly DependencyProperty DotBorderBrushProperty = DependencyProperty.Register(
|
||||
"DotBorderBrush", typeof(Brush), typeof(LoadingBase),
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace HandyControl.Controls
|
||||
StretchProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(Stretch.Uniform,
|
||||
OnPropertiesChanged));
|
||||
|
||||
StrokeThicknessProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(1.0,
|
||||
StrokeThicknessProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double1Box,
|
||||
OnPropertiesChanged));
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace HandyControl.Controls
|
||||
/// 最大页数
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty MaxPageCountProperty = DependencyProperty.Register(
|
||||
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(1, (o, args) =>
|
||||
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, (o, args) =>
|
||||
{
|
||||
if (o is Pagination pagination && args.NewValue is int value)
|
||||
{
|
||||
@@ -156,7 +156,7 @@ namespace HandyControl.Controls
|
||||
/// 当前页
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register(
|
||||
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(1, (o, args) =>
|
||||
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, (o, args) =>
|
||||
{
|
||||
if (o is Pagination pagination && args.NewValue is int value)
|
||||
{
|
||||
@@ -312,7 +312,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
var sub = PageIndex;
|
||||
for (int i = 0; i < MaxPageInterval - 1; i++)
|
||||
for (var i = 0; i < MaxPageInterval - 1; i++)
|
||||
{
|
||||
if (--sub > 1)
|
||||
{
|
||||
@@ -324,7 +324,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
var add = PageIndex;
|
||||
for (int i = 0; i < MaxPageInterval - 1; i++)
|
||||
for (var i = 0; i < MaxPageInterval - 1; i++)
|
||||
{
|
||||
if (++add < MaxPageCount)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
|
||||
base.OnVisualChildrenChanged(visualAdded, visualRemoved);
|
||||
|
||||
var count = Items.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var item = (RadioButton)Items[i];
|
||||
item.Style = ItemStyleSelector?.SelectStyle(item, this);
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Tools.Converter;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class RelativePanel : Panel
|
||||
{
|
||||
public static readonly DependencyProperty AboveProperty = DependencyProperty.RegisterAttached(
|
||||
"Above", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetAbove(DependencyObject element, DependencyObject value) => element.SetValue(AboveProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetAbove(DependencyObject element) => (DependencyObject)element.GetValue(AboveProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignBottomWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignBottomWith", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetAlignBottomWith(DependencyObject element, DependencyObject value) => element.SetValue(AlignBottomWithProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetAlignBottomWith(DependencyObject element) => (DependencyObject)element.GetValue(AlignBottomWithProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignBottomWithPanelProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignBottomWithPanel", typeof(bool), typeof(RelativePanel), new PropertyMetadata(default(bool)));
|
||||
|
||||
public static void SetAlignBottomWithPanel(DependencyObject element, bool value) => element.SetValue(AlignBottomWithPanelProperty, value);
|
||||
|
||||
public static bool GetAlignBottomWithPanel(DependencyObject element) => (bool)element.GetValue(AlignBottomWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignHorizontalCenterWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignHorizontalCenterWith", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetAlignHorizontalCenterWith(DependencyObject element, DependencyObject value) => element.SetValue(AlignHorizontalCenterWithProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetAlignHorizontalCenterWith(DependencyObject element) => (DependencyObject)element.GetValue(AlignHorizontalCenterWithProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignHorizontalCenterWithPanelProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignHorizontalCenterWithPanel", typeof(bool), typeof(RelativePanel), new PropertyMetadata(default(bool)));
|
||||
|
||||
public static void SetAlignHorizontalCenterWithPanel(DependencyObject element, bool value) => element.SetValue(AlignHorizontalCenterWithPanelProperty, value);
|
||||
|
||||
public static bool GetAlignHorizontalCenterWithPanel(DependencyObject element) => (bool)element.GetValue(AlignHorizontalCenterWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignLeftWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignLeftWith", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetAlignLeftWith(DependencyObject element, DependencyObject value) => element.SetValue(AlignLeftWithProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetAlignLeftWith(DependencyObject element) => (DependencyObject)element.GetValue(AlignLeftWithProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignLeftWithPanelProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignLeftWithPanel", typeof(bool), typeof(RelativePanel), new PropertyMetadata(default(bool)));
|
||||
|
||||
public static void SetAlignLeftWithPanel(DependencyObject element, bool value) => element.SetValue(AlignLeftWithPanelProperty, value);
|
||||
|
||||
public static bool GetAlignLeftWithPanel(DependencyObject element) => (bool)element.GetValue(AlignLeftWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignRightWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignRightWith", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetAlignRightWith(DependencyObject element, DependencyObject value) => element.SetValue(AlignRightWithProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetAlignRightWith(DependencyObject element) => (DependencyObject)element.GetValue(AlignRightWithProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignRightWithPanelProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignRightWithPanel", typeof(bool), typeof(RelativePanel), new PropertyMetadata(default(bool)));
|
||||
|
||||
public static void SetAlignRightWithPanel(DependencyObject element, bool value) => element.SetValue(AlignRightWithPanelProperty, value);
|
||||
|
||||
public static bool GetAlignRightWithPanel(DependencyObject element) => (bool)element.GetValue(AlignRightWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignTopWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignTopWith", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetAlignTopWith(DependencyObject element, DependencyObject value) => element.SetValue(AlignTopWithProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetAlignTopWith(DependencyObject element) => (DependencyObject)element.GetValue(AlignTopWithProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignTopWithPanelProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignTopWithPanel", typeof(bool), typeof(RelativePanel), new PropertyMetadata(default(bool)));
|
||||
|
||||
public static void SetAlignTopWithPanel(DependencyObject element, bool value) => element.SetValue(AlignTopWithPanelProperty, value);
|
||||
|
||||
public static bool GetAlignTopWithPanel(DependencyObject element) => (bool)element.GetValue(AlignTopWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignVerticalCenterWithProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignVerticalCenterWith", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetAlignVerticalCenterWith(DependencyObject element, DependencyObject value) => element.SetValue(AlignVerticalCenterWithProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetAlignVerticalCenterWith(DependencyObject element) => (DependencyObject)element.GetValue(AlignVerticalCenterWithProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignVerticalCenterWithPanelProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignVerticalCenterWithPanel", typeof(bool), typeof(RelativePanel), new PropertyMetadata(default(bool)));
|
||||
|
||||
public static void SetAlignVerticalCenterWithPanel(DependencyObject element, bool value) => element.SetValue(AlignVerticalCenterWithPanelProperty, value);
|
||||
|
||||
public static bool GetAlignVerticalCenterWithPanel(DependencyObject element) => (bool)element.GetValue(AlignVerticalCenterWithPanelProperty);
|
||||
|
||||
public static readonly DependencyProperty BelowProperty = DependencyProperty.RegisterAttached(
|
||||
"Below", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetBelow(DependencyObject element, DependencyObject value) => element.SetValue(BelowProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetBelow(DependencyObject element) => (DependencyObject)element.GetValue(BelowProperty);
|
||||
|
||||
public static readonly DependencyProperty LeftOfProperty = DependencyProperty.RegisterAttached(
|
||||
"LeftOf", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetLeftOf(DependencyObject element, DependencyObject value) => element.SetValue(LeftOfProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetLeftOf(DependencyObject element) => (DependencyObject)element.GetValue(LeftOfProperty);
|
||||
|
||||
public static readonly DependencyProperty RightOfProperty = DependencyProperty.RegisterAttached(
|
||||
"RightOf", typeof(DependencyObject), typeof(RelativePanel), new PropertyMetadata(default(DependencyObject)));
|
||||
|
||||
public static void SetRightOf(DependencyObject element, DependencyObject value) => element.SetValue(RightOfProperty, value);
|
||||
|
||||
[TypeConverter(typeof(NameReferenceConverter))]
|
||||
public static DependencyObject GetRightOf(DependencyObject element) => (DependencyObject)element.GetValue(RightOfProperty);
|
||||
}
|
||||
}
|
||||
@@ -353,7 +353,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (_visualChildren == null) return 0;
|
||||
|
||||
for (int i = 0; i < _visualChildren.Length; i++)
|
||||
for (var i = 0; i < _visualChildren.Length; i++)
|
||||
{
|
||||
if (_visualChildren[i] == null) return i;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace HandyControl.Controls
|
||||
var count = Items.Count;
|
||||
if (count <= 0) return;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (ItemContainerGenerator.ContainerFromIndex(i) is StepBarItem stepBarItem)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ namespace HandyControl.Controls
|
||||
|
||||
if (StepIndex < count)
|
||||
{
|
||||
for (int i = 0; i < StepIndex; i++)
|
||||
for (var i = 0; i < StepIndex; i++)
|
||||
{
|
||||
if (ItemContainerGenerator.ContainerFromIndex(i) is StepBarItem stepBarItem)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
|
||||
private void CreateItemsSource(ItemsControl selector, int count)
|
||||
{
|
||||
var list = new List<string>();
|
||||
for (int i = 0; i < count; i++)
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
list.Add(i.ToString("#00"));
|
||||
}
|
||||
|
||||
@@ -340,7 +340,10 @@ namespace HandyControl.Controls
|
||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey);
|
||||
}
|
||||
|
||||
messageBox.Style = info.Style;
|
||||
if (info.Style != null)
|
||||
{
|
||||
messageBox.Style = info.Style;
|
||||
}
|
||||
messageBox.ShowDialog();
|
||||
}));
|
||||
#else
|
||||
@@ -356,7 +359,10 @@ namespace HandyControl.Controls
|
||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey);
|
||||
}
|
||||
|
||||
messageBox.Style = info.Style;
|
||||
if (info.Style != null)
|
||||
{
|
||||
messageBox.Style = info.Style;
|
||||
}
|
||||
SystemSounds.Asterisk.Play();
|
||||
messageBox.ShowDialog();
|
||||
});
|
||||
|
||||
@@ -9,7 +9,6 @@ using HandyControl.Tools.Extension;
|
||||
using Microsoft.Windows.Shell;
|
||||
#else
|
||||
using System.Windows.Shell;
|
||||
|
||||
#endif
|
||||
|
||||
namespace HandyControl.Controls
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Windows.Input;
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
internal class KeyboardHookEventArgs : EventArgs
|
||||
public class KeyboardHookEventArgs : EventArgs
|
||||
{
|
||||
public bool IsSystemKey { get; }
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
namespace HandyControl_Shared.Data.Enum
|
||||
{
|
||||
public enum RelativeStatus
|
||||
{
|
||||
LeftOf,
|
||||
|
||||
Above,
|
||||
|
||||
RightOf,
|
||||
|
||||
Below,
|
||||
|
||||
AlignLeftWith,
|
||||
|
||||
AlignTopWith,
|
||||
|
||||
AlignRightWith,
|
||||
|
||||
AlignBottomWith,
|
||||
|
||||
AlignHorizontalCenterWith,
|
||||
|
||||
AlignVerticalCenterWith,
|
||||
|
||||
AlignLeftWithPanel,
|
||||
|
||||
AlignTopWithPanel,
|
||||
|
||||
AlignRightWithPanel,
|
||||
|
||||
AlignBottomWithPanel,
|
||||
|
||||
AlignHorizontalCenterWithPanel,
|
||||
|
||||
AlignVerticalCenterWithPanel
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace HandyControl.Data
|
||||
//
|
||||
var values = frameDelayItem.Value;
|
||||
_frameDelay = new int[FrameCount];
|
||||
for (int i = 0; i < FrameCount; ++i)
|
||||
for (var i = 0; i < FrameCount; ++i)
|
||||
{
|
||||
_frameDelay[i] = values[i * 4] + 256 * values[i * 4 + 1] + 256 * 256 * values[i * 4 + 2] + 256 * 256 * 256 * values[i * 4 + 3];
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace HandyControl.Expression.Drawing
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = list.Count - 1; i >= count; i--)
|
||||
for (var i = list.Count - 1; i >= count; i--)
|
||||
{
|
||||
list.RemoveAt(i);
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace HandyControl.Expression.Drawing
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = list.Count; i < count; i++)
|
||||
for (var i = list.Count; i < count; i++)
|
||||
{
|
||||
list.Add((factory == null) ? default(T) : factory());
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Expression.Drawing;
|
||||
using HandyControl.Expression.Media;
|
||||
|
||||
@@ -16,7 +17,7 @@ namespace HandyControl.Expression.Shapes
|
||||
StretchProperty.OverrideMetadata(typeof(PrimitiveShape),
|
||||
new DrawingPropertyMetadata(Stretch.Fill, DrawingPropertyMetadataOptions.AffectsRender));
|
||||
StrokeThicknessProperty.OverrideMetadata(typeof(PrimitiveShape),
|
||||
new DrawingPropertyMetadata(1.0, DrawingPropertyMetadataOptions.AffectsRender));
|
||||
new DrawingPropertyMetadata(ValueBoxes.Double1Box, DrawingPropertyMetadataOptions.AffectsRender));
|
||||
}
|
||||
|
||||
protected sealed override Geometry DefiningGeometry =>
|
||||
|
||||
@@ -18,13 +18,12 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\InfoElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\RelativePanel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeTrack.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeThumb.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\TwoWayRangeBase.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\RelativeStatus.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\Commands\OpenLinkCommand.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\NameReferenceConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Extension\FrameworkElementExtension.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Extension\StringExtension.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\GlobalShortcut.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\StatusSwitchElement.cs" />
|
||||
@@ -273,6 +272,10 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Interop\WNDCLASS.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Interop\WpfSafeHandle.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\MouseDragElementBehaviorEx.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Pool\IPool!1.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Pool\SimplePool!1.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Pool\SynchronizedPool!1.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Queue\Deque!1.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\RegularJudgment.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\RegularPatterns.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\StyleSelector\RadioGroupItemStyleSelector.cs" />
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Border.xaml"/>
|
||||
<ResourceDictionary Source="Base/ToggleButtonBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -101,6 +102,124 @@
|
||||
<!--开关-->
|
||||
<Style x:Key="ToggleButtonSwitch" BasedOn="{StaticResource ToggleButtonSwitchBaseStyle}" TargetType="ToggleButton"/>
|
||||
|
||||
<!--翻转-->
|
||||
<Style x:Key="ToggleButtonFlip" BasedOn="{StaticResource BaseStyle}" TargetType="ToggleButton">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="30"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard x:Key="StoryboardChecked">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="CheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="UnCheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="UnCheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="StoryboardUnChecked">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="CheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="UnCheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="UnCheckedElement">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<PowerEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Viewbox>
|
||||
<controls:SimplePanel Height="28" Width="28">
|
||||
<Border Name="UnCheckedElement" Style="{StaticResource BorderClip}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Border.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="1"/>
|
||||
</TransformGroup>
|
||||
</Border.RenderTransform>
|
||||
<ContentPresenter Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
<Border Name="CheckedElement" Style="{StaticResource BorderClip}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Border.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="0"/>
|
||||
</TransformGroup>
|
||||
</Border.RenderTransform>
|
||||
<ContentPresenter Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{Binding Path=(controls:StatusSwitchElement.CheckedElement),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Border>
|
||||
</controls:SimplePanel>
|
||||
</Viewbox>
|
||||
<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="IsChecked" Value="true">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource StoryboardChecked}"/>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource StoryboardUnChecked}"/>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.4"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--自定义-->
|
||||
<Style x:Key="ToggleButtonCustom" BasedOn="{StaticResource BaseStyle}" TargetType="ToggleButton">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace HandyControl.Tools.Extension
|
||||
{
|
||||
public static class FrameworkElementExtension
|
||||
{
|
||||
|
||||
public static double GetValidWidth(this FrameworkElement element)
|
||||
{
|
||||
if (!double.IsNaN(element.Width))
|
||||
{
|
||||
if (element.Width > 0)
|
||||
{
|
||||
return element.Width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (element.ActualWidth > 0)
|
||||
{
|
||||
return element.ActualWidth;
|
||||
}
|
||||
|
||||
if (element.DesiredSize.Width > 0)
|
||||
{
|
||||
return element.DesiredSize.Width;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static double GetValidHeight(this FrameworkElement element)
|
||||
{
|
||||
if (!double.IsNaN(element.Height))
|
||||
{
|
||||
if (element.Height > 0)
|
||||
{
|
||||
return element.Height;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (element.ActualHeight > 0)
|
||||
{
|
||||
return element.ActualHeight;
|
||||
}
|
||||
|
||||
if (element.DesiredSize.Height > 0)
|
||||
{
|
||||
return element.DesiredSize.Height;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace HandyControl.Tools
|
||||
try
|
||||
{
|
||||
// Find the corresponding reference and remove it
|
||||
for (int i = 0; i < ImageInfoList.Count; i++)
|
||||
for (var i = 0; i < ImageInfoList.Count; i++)
|
||||
{
|
||||
var imageInfo = ImageInfoList[i];
|
||||
|
||||
|
||||
@@ -27,23 +27,23 @@ namespace HandyControl.Tools
|
||||
}
|
||||
|
||||
var index = 0;
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
for (int j = 0; j < 5; j++, index++)
|
||||
for (var j = 0; j < 5; j++, index++)
|
||||
{
|
||||
AddRec(i, j, renderData[index] == 0);
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < 5; j++, index++)
|
||||
for (var j = 0; j < 5; j++, index++)
|
||||
{
|
||||
AddRec(2, j, renderData[index] == 0);
|
||||
}
|
||||
|
||||
index -= 10;
|
||||
for (int i = 3; i < 5; i++)
|
||||
for (var i = 3; i < 5; i++)
|
||||
{
|
||||
for (int j = 0; j < 5; j++, index++)
|
||||
for (var j = 0; j < 5; j++, index++)
|
||||
{
|
||||
AddRec(i, j, renderData[index] == 0);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ namespace HandyControl.Tools
|
||||
private int[] GetRenderData(string hashcode)
|
||||
{
|
||||
var arr = new int[RenderDataMaxLength];
|
||||
for (int i = 0; i < RenderDataMaxLength; i++)
|
||||
for (var i = 0; i < RenderDataMaxLength; i++)
|
||||
{
|
||||
var c = hashcode[i];
|
||||
var v = (int) c;
|
||||
|
||||
@@ -22,11 +22,11 @@ namespace HandyControl.Tools
|
||||
var arr = new int[count];
|
||||
var div = num / count;
|
||||
var rest = num % count;
|
||||
for (int i = 0; i < count; i++)
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
arr[i] = div;
|
||||
}
|
||||
for (int i = 0; i < rest; i++)
|
||||
for (var i = 0; i < rest; i++)
|
||||
{
|
||||
arr[i] += 1;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace HandyControl.Tools
|
||||
|
||||
var isBitmapIconDecoder = frames[0].Decoder is IconBitmapDecoder;
|
||||
|
||||
for (int i = 0; i < frames.Count && bestScore != 0; ++i)
|
||||
for (var i = 0; i < frames.Count && bestScore != 0; ++i)
|
||||
{
|
||||
var currentIconBitDepth = isBitmapIconDecoder ? frames[i].Thumbnail.Format.BitsPerPixel : frames[i].Format.BitsPerPixel;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace HandyControl.Tools
|
||||
return t;
|
||||
}
|
||||
|
||||
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
|
||||
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
|
||||
{
|
||||
var child = VisualTreeHelper.GetChild(d, i);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using HandyControl.Tools.Interop;
|
||||
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
internal class KeyboardHook
|
||||
public class KeyboardHook
|
||||
{
|
||||
public static event EventHandler<KeyboardHookEventArgs> KeyDown;
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
public interface IPool<T>
|
||||
{
|
||||
T Acquire();
|
||||
|
||||
bool Release(T instance);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
//adapted from https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/util/Pools.java
|
||||
|
||||
using System;
|
||||
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
public class SimplePool<T> : IPool<T>
|
||||
{
|
||||
private readonly object[] _pool;
|
||||
|
||||
private int _poolSize;
|
||||
|
||||
public SimplePool(int maxPoolSize)
|
||||
{
|
||||
if (maxPoolSize <= 0)
|
||||
{
|
||||
throw new ArgumentException("The max pool size must be > 0");
|
||||
}
|
||||
_pool = new object[maxPoolSize];
|
||||
}
|
||||
|
||||
public virtual T Acquire()
|
||||
{
|
||||
if (_poolSize > 0)
|
||||
{
|
||||
var lastPooledIndex = _poolSize - 1;
|
||||
var instance = (T)_pool[lastPooledIndex];
|
||||
_pool[lastPooledIndex] = null;
|
||||
_poolSize--;
|
||||
return instance;
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public virtual bool Release(T instance)
|
||||
{
|
||||
if (IsInPool(instance))
|
||||
{
|
||||
throw new Exception("Already in the pool!");
|
||||
}
|
||||
|
||||
if (_poolSize < _pool.Length)
|
||||
{
|
||||
_pool[_poolSize] = instance;
|
||||
_poolSize++;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsInPool(T instance)
|
||||
{
|
||||
for (var i = 0; i < _poolSize; i++)
|
||||
{
|
||||
if (Equals(_pool[i], instance))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
public class SynchronizedPool<T> : SimplePool<T>
|
||||
{
|
||||
private readonly object _lockObj = new object();
|
||||
|
||||
public SynchronizedPool(int maxPoolSize) : base(maxPoolSize)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override T Acquire()
|
||||
{
|
||||
lock (_lockObj)
|
||||
{
|
||||
return base.Acquire();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Release(T element)
|
||||
{
|
||||
lock (_lockObj) {
|
||||
return base.Release(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
// adapted from https://www.c-sharpcorner.com/uploadfile/b942f9/implementing-a-double-ended-queue-or-deque-in-c-sharp/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
[Serializable]
|
||||
public class Deque<T> : IEnumerable<T>, ICollection
|
||||
{
|
||||
[NonSerialized]
|
||||
private object _syncRoot;
|
||||
|
||||
private List<T> _front;
|
||||
|
||||
private List<T> _back;
|
||||
|
||||
private int _frontDeleted;
|
||||
|
||||
private int _backDeleted;
|
||||
|
||||
public int Capacity => _front.Capacity + _back.Capacity;
|
||||
|
||||
public int Count => _front.Count + _back.Count - _frontDeleted - _backDeleted;
|
||||
|
||||
public bool IsEmpty => Count == 0;
|
||||
|
||||
public IEnumerable<T> Reversed
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_back.Count - _backDeleted > 0)
|
||||
{
|
||||
for (var i = _back.Count - 1; i >= _backDeleted; i--) yield return _back[i];
|
||||
}
|
||||
|
||||
if (_front.Count - _frontDeleted > 0)
|
||||
{
|
||||
for (var i = _frontDeleted; i < _front.Count; i++) yield return _front[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Deque()
|
||||
{
|
||||
_front = new List<T>();
|
||||
_back = new List<T>();
|
||||
}
|
||||
|
||||
public Deque(int capacity)
|
||||
{
|
||||
if (capacity < 0) throw new ArgumentException("Capacity cannot be negative");
|
||||
var temp = capacity / 2;
|
||||
var temp2 = capacity - temp;
|
||||
_front = new List<T>(temp);
|
||||
_back = new List<T>(temp2);
|
||||
}
|
||||
|
||||
public Deque(IEnumerable<T> backCollection) : this(backCollection, null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Deque(IEnumerable<T> backCollection, IEnumerable<T> frontCollection)
|
||||
{
|
||||
if (backCollection == null && frontCollection == null) throw new ArgumentException("Collections cannot both be null");
|
||||
_front = new List<T>();
|
||||
_back = new List<T>();
|
||||
|
||||
if (backCollection != null)
|
||||
{
|
||||
foreach (var item in backCollection) _back.Add(item);
|
||||
}
|
||||
|
||||
if (frontCollection != null)
|
||||
{
|
||||
foreach (var item in frontCollection) _front.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddFirst(T item)
|
||||
{
|
||||
if (_frontDeleted > 0 && _front.Count == _front.Capacity)
|
||||
{
|
||||
_front.RemoveRange(0, _frontDeleted);
|
||||
_frontDeleted = 0;
|
||||
}
|
||||
|
||||
_front.Add(item);
|
||||
}
|
||||
|
||||
public void AddLast(T item)
|
||||
{
|
||||
if (_backDeleted > 0 && _back.Count == _back.Capacity)
|
||||
{
|
||||
_back.RemoveRange(0, _backDeleted);
|
||||
_backDeleted = 0;
|
||||
}
|
||||
|
||||
_back.Add(item);
|
||||
}
|
||||
|
||||
public void AddRangeFirst(IEnumerable<T> range)
|
||||
{
|
||||
if (range == null) return;
|
||||
|
||||
foreach (var item in range) AddFirst(item);
|
||||
}
|
||||
|
||||
public void AddRangeLast(IEnumerable<T> range)
|
||||
{
|
||||
if (range == null) return;
|
||||
|
||||
foreach (var item in range) AddLast(item);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_front.Clear();
|
||||
_back.Clear();
|
||||
_frontDeleted = 0;
|
||||
_backDeleted = 0;
|
||||
}
|
||||
|
||||
public bool Contains(T item)
|
||||
{
|
||||
for (var i = _frontDeleted; i < _front.Count; i++)
|
||||
{
|
||||
if (Equals(_front[i], item)) return true;
|
||||
}
|
||||
|
||||
for (var i = _backDeleted; i < _back.Count; i++)
|
||||
{
|
||||
if (Equals(_back[i], item)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void CopyTo(T[] array, int index)
|
||||
{
|
||||
if (array == null) throw new ArgumentNullException("Array cannot be null");
|
||||
if (index < 0) throw new ArgumentOutOfRangeException("Index cannot be negative");
|
||||
if (array.Length < index + Count) throw new ArgumentException("Index is invalid");
|
||||
var i = index;
|
||||
|
||||
foreach (var item in this)
|
||||
{
|
||||
array[i++] = item;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
if (_front.Count - _frontDeleted > 0)
|
||||
{
|
||||
for (var i = _front.Count - 1; i >= _frontDeleted; i--) yield return _front[i];
|
||||
}
|
||||
|
||||
if (_back.Count - _backDeleted > 0)
|
||||
{
|
||||
for (var i = _backDeleted; i < _back.Count; i++) yield return _back[i];
|
||||
}
|
||||
}
|
||||
|
||||
public T PeekFirst()
|
||||
{
|
||||
if (_front.Count > _frontDeleted)
|
||||
{
|
||||
return _front[_front.Count - 1];
|
||||
}
|
||||
|
||||
if (_back.Count > _backDeleted)
|
||||
{
|
||||
return _back[_backDeleted];
|
||||
}
|
||||
|
||||
throw new InvalidOperationException("Can't peek at empty Deque");
|
||||
}
|
||||
|
||||
public T PeekLast()
|
||||
{
|
||||
if (_back.Count > _backDeleted)
|
||||
{
|
||||
return _back[_back.Count - 1];
|
||||
}
|
||||
|
||||
if (_front.Count > _frontDeleted)
|
||||
{
|
||||
return _front[_frontDeleted];
|
||||
}
|
||||
|
||||
throw new InvalidOperationException("Can't peek at empty Deque");
|
||||
}
|
||||
|
||||
public T PopFirst()
|
||||
{
|
||||
T result;
|
||||
|
||||
if (_front.Count > _frontDeleted)
|
||||
{
|
||||
result = _front[_front.Count - 1];
|
||||
_front.RemoveAt(_front.Count - 1);
|
||||
}
|
||||
else if (_back.Count > _backDeleted)
|
||||
{
|
||||
result = _back[_backDeleted];
|
||||
_backDeleted++;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Can't pop empty Deque");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public T PopLast()
|
||||
{
|
||||
T result;
|
||||
|
||||
if (_back.Count > _backDeleted)
|
||||
{
|
||||
result = _back[_back.Count - 1];
|
||||
_back.RemoveAt(_back.Count - 1);
|
||||
}
|
||||
else if (_front.Count > _frontDeleted)
|
||||
{
|
||||
result = _front[_frontDeleted];
|
||||
_frontDeleted++;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Can't pop empty Deque");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Reverse()
|
||||
{
|
||||
var temp = _front;
|
||||
_front = _back;
|
||||
_back = temp;
|
||||
var temp2 = _frontDeleted;
|
||||
_frontDeleted = _backDeleted;
|
||||
_backDeleted = temp2;
|
||||
}
|
||||
|
||||
public T[] ToArray()
|
||||
{
|
||||
if (Count == 0) return new T[0];
|
||||
var result = new T[Count];
|
||||
CopyTo(result, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void TrimExcess()
|
||||
{
|
||||
if (_frontDeleted > 0)
|
||||
{
|
||||
_front.RemoveRange(0, _frontDeleted);
|
||||
_frontDeleted = 0;
|
||||
}
|
||||
|
||||
if (_backDeleted > 0)
|
||||
{
|
||||
_back.RemoveRange(0, _backDeleted);
|
||||
_backDeleted = 0;
|
||||
}
|
||||
|
||||
_front.TrimExcess();
|
||||
_back.TrimExcess();
|
||||
}
|
||||
|
||||
public bool TryPeekFirst(out T item)
|
||||
{
|
||||
if (!IsEmpty)
|
||||
{
|
||||
item = PeekFirst();
|
||||
return true;
|
||||
}
|
||||
|
||||
item = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryPeekLast(out T item)
|
||||
{
|
||||
if (!IsEmpty)
|
||||
{
|
||||
item = PeekLast();
|
||||
return true;
|
||||
}
|
||||
|
||||
item = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryPopFirst(out T item)
|
||||
{
|
||||
if (!IsEmpty)
|
||||
{
|
||||
item = PopFirst();
|
||||
return true;
|
||||
}
|
||||
|
||||
item = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryPopLast(out T item)
|
||||
{
|
||||
if (!IsEmpty)
|
||||
{
|
||||
item = PopLast();
|
||||
return true;
|
||||
}
|
||||
|
||||
item = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ICollection.IsSynchronized => false;
|
||||
|
||||
object ICollection.SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_syncRoot == null)
|
||||
{
|
||||
Interlocked.CompareExchange<object>(ref _syncRoot, new object(), null);
|
||||
}
|
||||
return _syncRoot;
|
||||
}
|
||||
}
|
||||
|
||||
void ICollection.CopyTo(Array array, int index) => CopyTo((T[])array, index);
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user