Merge pull request #195 from HandyOrg/add-Divider

Add divider
This commit is contained in:
NaBian authored and GitHub committed 2019-10-27 22:49:21 +08:00
commit 84022bcb32
29 files changed
+346 -51

No files matched your search

+6 -2
View File
@@ -65,6 +65,10 @@ Step 4:enjoy coding
## Latest examples
### Divider
![Divider](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Divider.png)
### GeometryAnimation
![GeometryAnimation](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/GeometryAnimation.gif)
@@ -81,6 +85,8 @@ Step 4:enjoy coding
![HoneycombPanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/HoneycombPanel.png)
## History publication
### RunningBlock
![RunningBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RunningBlock.gif)
@@ -91,8 +97,6 @@ Step 4:enjoy coding
![ImageBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/ImageBlock.png)
## History publication
### Magnifier
![Magnifier](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Magnifier.png)
@@ -5,13 +5,14 @@
<UseWPF>true</UseWPF>
<AssemblyName>HandyControlDemo</AssemblyName>
<RootNamespace>HandyControlDemo</RootNamespace>
<Version>2.2.0</Version>
<Version>2.3.0</Version>
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
<Configurations>Debug;Release</Configurations>
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
<FileVersion>2.2.0.0</FileVersion>
<AssemblyVersion>2.2.0.0</AssemblyVersion>
<FileVersion>2.3.0.0</FileVersion>
<AssemblyVersion>2.3.0.0</AssemblyVersion>
<LangVersion>8.0</LangVersion>
<Authors>HandyOrg</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;Core</DefineConstants>
@@ -426,6 +427,9 @@
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DataGenerator_16x.png">
<Link>Resources\Img\LeftMainContent\DataGenerator_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DottedSplitter_16x.png">
<Link>Resources\Img\LeftMainContent\DottedSplitter_16x.png</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
@@ -4,14 +4,15 @@
<UseWPF>true</UseWPF>
<AssemblyName>HandyControl</AssemblyName>
<RootNamespace>HandyControl</RootNamespace>
<Version>2.2.0</Version>
<AssemblyVersion>2.2.0.0</AssemblyVersion>
<Version>2.3.0</Version>
<AssemblyVersion>2.3.0.0</AssemblyVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
<Description>Contains some commonly used simple WPF controls</Description>
<Configurations>Debug;Release</Configurations>
<LangVersion>8.0</LangVersion>
<Authors>HandyOrg</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;Core</DefineConstants>
@@ -427,6 +427,9 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput>
</Content>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DottedSplitter_16x.png">
<Link>Resources\Img\LeftMainContent\DottedSplitter_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\qq_group_1.jpg">
<Link>Resources\Img\qq_group_1.jpg</Link>
</Resource>
@@ -496,6 +496,9 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput>
</Content>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DottedSplitter_16x.png">
<Link>Resources\Img\LeftMainContent\DottedSplitter_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\qq_group_1.jpg">
<Link>Resources\Img\qq_group_1.jpg</Link>
</Resource>
@@ -120,6 +120,8 @@
public static readonly string SplitButtonDemoCtl = nameof(SplitButtonDemoCtl);
public static readonly string DividerDemoCtl = nameof(DividerDemoCtl);
/*-------------------- Tools --------------------*/
public static readonly string HatchBrushGeneratorDemoCtl = nameof(HatchBrushGeneratorDemoCtl);
@@ -61,7 +61,8 @@ var controlList = new List<string>
"SpriteDemoCtl",
"NotificationDemoCtl",
"FloatingBlockDemoCtl",
"SplitButtonDemoCtl"
"SplitButtonDemoCtl",
"DividerDemoCtl"
};
var styleList = new List<string>
{
@@ -55,6 +55,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml.cs">
<DependentUpon>CardDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\DividerDemoCtl.xaml.cs">
<DependentUpon>DividerDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\FloatingBlockDemoCtl.xaml.cs">
<DependentUpon>FloatingBlockDemoCtl.xaml</DependentUpon>
</Compile>
@@ -460,6 +463,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\DividerDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\FloatingBlockDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -26,16 +26,18 @@
<hc:Window.NonClientAreaContent>
<userControl:NoUserContent/>
</hc:Window.NonClientAreaContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" MinWidth="200" MaxWidth="400"/>
<ColumnDefinition MinWidth="200"/>
</Grid.ColumnDefinitions>
<userControl:LeftMainContent/>
<userControl:MainContent Grid.Column="1"/>
<GridSplitter Grid.Column="1" HorizontalAlignment="Left" Width="4" Background="Transparent" BorderThickness="1,0,0,0" BorderBrush="{DynamicResource BorderBrush}"/>
<hc:ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsEnableInertia="True" IsPenetrating="True">
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10"/>
</hc:ScrollViewer>
</Grid>
<Border BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" MinWidth="200" MaxWidth="400"/>
<ColumnDefinition MinWidth="200"/>
</Grid.ColumnDefinitions>
<userControl:LeftMainContent/>
<userControl:MainContent Grid.Column="1"/>
<GridSplitter Grid.Column="1" HorizontalAlignment="Left" Width="4" Background="Transparent" BorderThickness="1,0,0,0" BorderBrush="{DynamicResource BorderBrush}"/>
<hc:ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsEnableInertia="True" IsPenetrating="True">
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10"/>
</hc:ScrollViewer>
</Grid>
</Border>
</hc:BlurWindow>
@@ -13,5 +13,5 @@ using System.Windows;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("2.2.0")]
[assembly: AssemblyVersion("2.3.0")]
#endif
@@ -492,6 +492,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 分割线 的本地化字符串。
/// </summary>
public static string Divider {
get {
return ResourceManager.GetString("Divider", resourceCulture);
}
}
/// <summary>
/// 查找类似 在这里拖拽 的本地化字符串。
/// </summary>
@@ -675,4 +675,7 @@
<data name="Morphing Animation" xml:space="preserve">
<value>Morphing Animation</value>
</data>
<data name="Divider" xml:space="preserve">
<value>Divider</value>
</data>
</root>
@@ -675,4 +675,7 @@
<data name="Morphing Animation" xml:space="preserve">
<value>Morphing Animation</value>
</data>
<data name="Divider" xml:space="preserve">
<value>Divider</value>
</data>
</root>
@@ -675,4 +675,7 @@
<data name="Morphing Animation" xml:space="preserve">
<value>Morphing Animation</value>
</data>
<data name="Divider" xml:space="preserve">
<value>Divider</value>
</data>
</root>
@@ -675,4 +675,7 @@
<data name="Morphing Animation" xml:space="preserve">
<value>变形动画</value>
</data>
<data name="Divider" xml:space="preserve">
<value>分割线</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

@@ -0,0 +1,43 @@
<UserControl x:Class="HandyControlDemo.UserControl.DividerDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs">
<hc:TransitioningContentControl>
<WrapPanel Margin="16">
<StackPanel Margin="16" Width="300">
<hc:Divider/>
<hc:Divider Content="{x:Static langs:Lang.Title}"/>
<hc:Divider Content="{x:Static langs:Lang.Title}" Padding="10,0"/>
<hc:Divider LineStrokeThickness="2" LineStroke="{DynamicResource DarkPrimaryBrush}"/>
<hc:Divider LineStrokeDashArray="2,2"/>
</StackPanel>
<StackPanel Margin="16" Width="300">
<hc:Divider Content="{x:Static langs:Lang.Title}" HorizontalContentAlignment="Left"/>
<hc:Divider Content="{x:Static langs:Lang.Title}" Padding="10,0" HorizontalContentAlignment="Right"/>
<StackPanel Orientation="Horizontal">
<Button Content="{x:Static langs:Lang.Button}"/>
<hc:Divider Orientation="Vertical" MaxHeight="16"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<hc:Divider Orientation="Vertical" MaxHeight="16"/>
<Button Content="{x:Static langs:Lang.Button}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,16,0,0">
<Button Content="{x:Static langs:Lang.Button}"/>
<hc:Divider LineStrokeThickness="2" Orientation="Vertical" MaxHeight="16"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<hc:Divider LineStrokeThickness="2" Orientation="Vertical" MaxHeight="16"/>
<Button Content="{x:Static langs:Lang.Button}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,16,0,0">
<Button Content="{x:Static langs:Lang.Button}"/>
<hc:Divider LineStrokeThickness="2" LineStroke="{DynamicResource DarkPrimaryBrush}" Orientation="Vertical" MaxHeight="16"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<hc:Divider LineStrokeThickness="2" LineStroke="{DynamicResource DarkPrimaryBrush}" Orientation="Vertical" MaxHeight="16"/>
<Button Content="{x:Static langs:Lang.Button}"/>
</StackPanel>
</StackPanel>
</WrapPanel>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class DividerDemoCtl
{
public DividerDemoCtl()
{
InitializeComponent();
}
}
}
@@ -345,6 +345,11 @@
<Image Source="../../Resources/Img/LeftMainContent/VSO_Card_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.DividerDemoCtl}" Content="{x:Static langs:Lang.Divider}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/DottedSplitter_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CirclePanelDemoCtl}" Content="{x:Static langs:Lang.CirclePanel}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ColorWheel_16x.png"/>
@@ -455,7 +460,7 @@
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.SpriteDemoCtl}" Content="{x:Static langs:Lang.Sprite}">
<ListBoxItem 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>
@@ -1,4 +1,5 @@
using System.Windows;
using System;
using System.Windows;
using System.Windows.Controls;
using HandyControl.Data;
using HandyControl.Tools.Extension;
@@ -40,32 +41,48 @@ namespace HandyControl.Controls
set => SetValue(SpanProperty, value);
}
public static readonly DependencyProperty IsFixedProperty = DependencyProperty.Register(
"IsFixed", typeof(bool), typeof(Col), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsFixed
{
get => (bool) GetValue(IsFixedProperty);
set => SetValue(IsFixedProperty, value);
}
internal int GetLayoutCellCount(ColLayoutStatus status)
{
var result = 0;
if (Layout != null)
{
switch (status)
if (!IsFixed)
{
case ColLayoutStatus.Xs:
result = Layout.Xs;
break;
case ColLayoutStatus.Sm:
result = Layout.Sm;
break;
case ColLayoutStatus.Md:
result = Layout.Md;
break;
case ColLayoutStatus.Lg:
result = Layout.Lg;
break;
case ColLayoutStatus.Xl:
result = Layout.Xl;
break;
case ColLayoutStatus.Xxl:
result = Layout.Xxl;
break;
switch (status)
{
case ColLayoutStatus.Xs:
result = Layout.Xs;
break;
case ColLayoutStatus.Sm:
result = Layout.Sm;
break;
case ColLayoutStatus.Md:
result = Layout.Md;
break;
case ColLayoutStatus.Lg:
result = Layout.Lg;
break;
case ColLayoutStatus.Xl:
result = Layout.Xl;
break;
case ColLayoutStatus.Xxl:
result = Layout.Xxl;
break;
case ColLayoutStatus.Auto:
break;
default:
throw new ArgumentOutOfRangeException(nameof(status), status, null);
}
}
}
else
@@ -13,6 +13,8 @@ namespace HandyControl.Controls
private double _maxChildDesiredHeight;
private double _totalAutoWidth;
public static readonly DependencyProperty GutterProperty = DependencyProperty.Register(
"Gutter", typeof(double), typeof(Row), new PropertyMetadata(ValueBoxes.Double0Box, null, OnGutterCoerce), ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
@@ -29,6 +31,7 @@ namespace HandyControl.Controls
var totalCellCount = 0;
var totalRowCount = 1;
var gutterHalf = Gutter / 2;
_totalAutoWidth = 0;
foreach (var child in InternalChildren.OfType<Col>())
{
@@ -40,12 +43,7 @@ namespace HandyControl.Controls
{
_maxChildDesiredHeight = childDesiredSize.Height;
}
}
_layoutStatus = ColLayout.GetLayoutStatus(constraint.Width);
foreach (var child in InternalChildren.OfType<Col>())
{
var cellCount = child.GetLayoutCellCount(_layoutStatus);
totalCellCount += cellCount;
@@ -54,16 +52,21 @@ namespace HandyControl.Controls
totalCellCount = cellCount;
totalRowCount++;
}
if (cellCount == 0 || child.IsFixed)
{
_totalAutoWidth += childDesiredSize.Width;
}
}
return new Size(0, _maxChildDesiredHeight * totalRowCount - Gutter);
return new Size(constraint.Width, _maxChildDesiredHeight * totalRowCount - Gutter);
}
protected override Size ArrangeOverride(Size finalSize)
{
var totalCellCount = 0;
var gutterHalf = Gutter / 2;
var itemWidth = (finalSize.Width + Gutter) / ColLayout.ColMaxCellCount;
var itemWidth = (finalSize.Width - _totalAutoWidth + Gutter) / ColLayout.ColMaxCellCount;
var childBounds = new Rect(-gutterHalf, -gutterHalf, 0, _maxChildDesiredHeight);
_layoutStatus = ColLayout.GetLayoutStatus(finalSize.Width);
@@ -72,7 +75,8 @@ namespace HandyControl.Controls
var cellCount = child.GetLayoutCellCount(_layoutStatus);
totalCellCount += cellCount;
var childWidth = cellCount * itemWidth;
var childWidth = cellCount > 0 ? cellCount * itemWidth : child.DesiredSize.Width;
childBounds.Width = childWidth;
childBounds.X += child.Offset * itemWidth;
if (totalCellCount > ColLayout.ColMaxCellCount)
@@ -0,0 +1,82 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using HandyControl.Data;
namespace HandyControl.Controls
{
public class Divider : Control
{
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(object), typeof(Divider), new PropertyMetadata(default(object)));
public object Content
{
get => GetValue(ContentProperty);
set => SetValue(ContentProperty, value);
}
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(Divider), new PropertyMetadata(default(Orientation)));
public Orientation Orientation
{
get => (Orientation) GetValue(OrientationProperty);
set => SetValue(OrientationProperty, value);
}
public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.Register(
"ContentTemplate", typeof(DataTemplate), typeof(Divider), new PropertyMetadata(default(DataTemplate)));
public DataTemplate ContentTemplate
{
get => (DataTemplate) GetValue(ContentTemplateProperty);
set => SetValue(ContentTemplateProperty, value);
}
public static readonly DependencyProperty ContentStringFormatProperty = DependencyProperty.Register(
"ContentStringFormat", typeof(string), typeof(Divider), new PropertyMetadata(default(string)));
public string ContentStringFormat
{
get => (string) GetValue(ContentStringFormatProperty);
set => SetValue(ContentStringFormatProperty, value);
}
public static readonly DependencyProperty ContentTemplateSelectorProperty = DependencyProperty.Register(
"ContentTemplateSelector", typeof(DataTemplateSelector), typeof(Divider), new PropertyMetadata(default(DataTemplateSelector)));
public DataTemplateSelector ContentTemplateSelector
{
get => (DataTemplateSelector) GetValue(ContentTemplateSelectorProperty);
set => SetValue(ContentTemplateSelectorProperty, value);
}
public static readonly DependencyProperty LineStrokeProperty = DependencyProperty.Register(
"LineStroke", typeof(Brush), typeof(Divider), new PropertyMetadata(default(Brush)));
public Brush LineStroke
{
get => (Brush) GetValue(LineStrokeProperty);
set => SetValue(LineStrokeProperty, value);
}
public static readonly DependencyProperty LineStrokeThicknessProperty = DependencyProperty.Register(
"LineStrokeThickness", typeof(double), typeof(Divider), new PropertyMetadata(ValueBoxes.Double1Box));
public double LineStrokeThickness
{
get => (double) GetValue(LineStrokeThicknessProperty);
set => SetValue(LineStrokeThicknessProperty, value);
}
public static readonly DependencyProperty LineStrokeDashArrayProperty = DependencyProperty.Register(
"LineStrokeDashArray", typeof(DoubleCollection), typeof(Divider), new PropertyMetadata(new DoubleCollection()));
public DoubleCollection LineStrokeDashArray
{
get => (DoubleCollection) GetValue(LineStrokeDashArrayProperty);
set => SetValue(LineStrokeDashArrayProperty, value);
}
}
}
@@ -8,5 +8,6 @@
Lg,
Xl,
Xxl,
Auto
}
}
@@ -24,6 +24,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\Button\SplitButton.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Growl\GrowlWindow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Image\ImageBlock.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Divider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Magnifier.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ButtonGroup.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Card.cs" />
@@ -381,6 +382,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\DividerBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\CardBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -425,6 +430,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Divider.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\FloatingBlock.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("2.2.0")]
[assembly: AssemblyVersion("2.3.0")]
#endif
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Controls")]
@@ -0,0 +1,63 @@
<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">
<Style x:Key="DividerBaseStyle" TargetType="controls:Divider">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Margin" Value="0,24"/>
<Setter Property="Padding" Value="24,0"/>
<Setter Property="LineStroke" Value="{DynamicResource BorderBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Divider">
<controls:Row>
<controls:Col Layout="12" x:Name="ColStart">
<Line VerticalAlignment="Center" StrokeDashArray="{TemplateBinding LineStrokeDashArray}" Stroke="{TemplateBinding LineStroke}" X2="1" StrokeThickness="{TemplateBinding LineStrokeThickness}" Stretch="Fill" StrokeEndLineCap="Square" StrokeStartLineCap="Square"/>
</controls:Col>
<controls:Col Layout="0">
<ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
</controls:Col>
<controls:Col Layout="12" x:Name="ColEnd">
<Line VerticalAlignment="Center" StrokeDashArray="{TemplateBinding LineStrokeDashArray}" Stroke="{TemplateBinding LineStroke}" X2="1" StrokeThickness="{TemplateBinding LineStrokeThickness}" Stretch="Fill" StrokeEndLineCap="Square" StrokeStartLineCap="Square"/>
</controls:Col>
</controls:Row>
<ControlTemplate.Triggers>
<Trigger Property="Content" Value="{x:Null}">
<Setter Property="Padding" Value="0"/>
</Trigger>
<Trigger Property="HorizontalContentAlignment" Value="Left">
<Setter TargetName="ColStart" Property="Layout" Value="0"/>
<Setter TargetName="ColStart" Property="IsFixed" Value="True"/>
<Setter TargetName="ColStart" Property="Width" Value="20"/>
<Setter TargetName="ColEnd" Property="Layout" Value="24"/>
</Trigger>
<Trigger Property="HorizontalContentAlignment" Value="Right">
<Setter TargetName="ColEnd" Property="Layout" Value="0"/>
<Setter TargetName="ColEnd" Property="IsFixed" Value="True"/>
<Setter TargetName="ColEnd" Property="Width" Value="20"/>
<Setter TargetName="ColStart" Property="Layout" Value="24"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Content" Value="{x:Null}">
<Setter Property="Padding" Value="0"/>
</Trigger>
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="Margin" Value="6,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Divider">
<Line HorizontalAlignment="Center" StrokeDashArray="{TemplateBinding LineStrokeDashArray}" Stroke="{TemplateBinding LineStroke}" Y2="1" StrokeThickness="{TemplateBinding LineStrokeThickness}" Stretch="Fill" StrokeEndLineCap="Square" StrokeStartLineCap="Square"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
@@ -0,0 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base/DividerBaseStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource DividerBaseStyle}" TargetType="controls:Divider"/>
</ResourceDictionary>
@@ -75,6 +75,7 @@
<ResourceDictionary Source="Notification.xaml"/>
<ResourceDictionary Source="FloatingBlock.xaml"/>
<ResourceDictionary Source="SplitButton.xaml"/>
<ResourceDictionary Source="Divider.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
@@ -13,6 +13,8 @@ namespace HandyControl.Tools.Extension
{
public static readonly int ColMaxCellCount = 24;
public static readonly int HalfColMaxCellCount = 12;
public static readonly int XsMaxWidth = 768;
public static readonly int SmMaxWidth = 992;