mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-11-30 02:48:03 +08:00
init branch
This commit is contained in:
parent
c6fbffb32e
commit
a34a0a9662
99
src/Shared/HandyControl_Shared/Controls/Panel/FlexPanel.cs
Normal file
99
src/Shared/HandyControl_Shared/Controls/Panel/FlexPanel.cs
Normal file
@ -0,0 +1,99 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class FlexPanel : Panel
|
||||
{
|
||||
public static readonly DependencyProperty OrderProperty = DependencyProperty.RegisterAttached(
|
||||
"Order", typeof(int), typeof(FlexPanel), new PropertyMetadata(ValueBoxes.Int0Box));
|
||||
|
||||
public static void SetOrder(DependencyObject element, int value)
|
||||
=> element.SetValue(OrderProperty, value);
|
||||
|
||||
public static int GetOrder(DependencyObject element)
|
||||
=> (int) element.GetValue(OrderProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexGrowProperty = DependencyProperty.RegisterAttached(
|
||||
"FlexGrow", typeof(double), typeof(FlexPanel), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||
|
||||
public static void SetFlexGrow(DependencyObject element, double value)
|
||||
=> element.SetValue(FlexGrowProperty, value);
|
||||
|
||||
public static double GetFlexGrow(DependencyObject element)
|
||||
=> (double) element.GetValue(FlexGrowProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexShrinkProperty = DependencyProperty.RegisterAttached(
|
||||
"FlexShrink", typeof(double), typeof(FlexPanel), new PropertyMetadata(ValueBoxes.Double1Box));
|
||||
|
||||
public static void SetFlexShrink(DependencyObject element, double value)
|
||||
=> element.SetValue(FlexShrinkProperty, value);
|
||||
|
||||
public static double GetFlexShrink(DependencyObject element)
|
||||
=> (double) element.GetValue(FlexShrinkProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexBasisProperty = DependencyProperty.RegisterAttached(
|
||||
"FlexBasis", typeof(double), typeof(FlexPanel), new PropertyMetadata(double.NaN));
|
||||
|
||||
public static void SetFlexBasis(DependencyObject element, double value)
|
||||
=> element.SetValue(FlexBasisProperty, value);
|
||||
|
||||
public static double GetFlexBasis(DependencyObject element)
|
||||
=> (double) element.GetValue(FlexBasisProperty);
|
||||
|
||||
public static readonly DependencyProperty AlignSelfProperty = DependencyProperty.RegisterAttached(
|
||||
"AlignSelf", typeof(FlexItemAlignment), typeof(FlexPanel), new PropertyMetadata(default(FlexItemAlignment)));
|
||||
|
||||
public static void SetAlignSelf(DependencyObject element, FlexItemAlignment value)
|
||||
=> element.SetValue(AlignSelfProperty, value);
|
||||
|
||||
public static FlexItemAlignment GetAlignSelf(DependencyObject element)
|
||||
=> (FlexItemAlignment) element.GetValue(AlignSelfProperty);
|
||||
|
||||
public static readonly DependencyProperty FlexDirectionProperty = DependencyProperty.Register(
|
||||
"FlexDirection", typeof(FlexOrientation), typeof(FlexPanel), new PropertyMetadata(default(FlexOrientation)));
|
||||
|
||||
public FlexOrientation FlexDirection
|
||||
{
|
||||
get => (FlexOrientation) GetValue(FlexDirectionProperty);
|
||||
set => SetValue(FlexDirectionProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FlexWrapProperty = DependencyProperty.Register(
|
||||
"FlexWrap", typeof(FlexWrapping), typeof(FlexPanel), new PropertyMetadata(default(FlexWrapping)));
|
||||
|
||||
public FlexWrapping FlexWrap
|
||||
{
|
||||
get => (FlexWrapping) GetValue(FlexWrapProperty);
|
||||
set => SetValue(FlexWrapProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty JustifyContentProperty = DependencyProperty.Register(
|
||||
"JustifyContent", typeof(FlexContentJustify), typeof(FlexPanel), new PropertyMetadata(default(FlexContentJustify)));
|
||||
|
||||
public FlexContentJustify JustifyContent
|
||||
{
|
||||
get => (FlexContentJustify) GetValue(JustifyContentProperty);
|
||||
set => SetValue(JustifyContentProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AlignItemsProperty = DependencyProperty.Register(
|
||||
"AlignItems", typeof(FlexItemsAlignment), typeof(FlexPanel), new PropertyMetadata(default(FlexItemsAlignment)));
|
||||
|
||||
public FlexItemsAlignment AlignItems
|
||||
{
|
||||
get => (FlexItemsAlignment) GetValue(AlignItemsProperty);
|
||||
set => SetValue(AlignItemsProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AlignContentProperty = DependencyProperty.Register(
|
||||
"AlignContent", typeof(FlexContentAlignment), typeof(FlexPanel), new PropertyMetadata(default(FlexContentAlignment)));
|
||||
|
||||
public FlexContentAlignment AlignContent
|
||||
{
|
||||
get => (FlexContentAlignment) GetValue(AlignContentProperty);
|
||||
set => SetValue(AlignContentProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum FlexContentAlignment
|
||||
{
|
||||
FlexStart,
|
||||
FlexEnd,
|
||||
Center,
|
||||
SpaceBetween,
|
||||
SpaceAround,
|
||||
Stretch
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum FlexContentJustify
|
||||
{
|
||||
FlexStart,
|
||||
FlexEnd,
|
||||
Center,
|
||||
SpaceBetween,
|
||||
SpaceAround
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum FlexItemAlignment
|
||||
{
|
||||
Auto,
|
||||
FlexStart,
|
||||
FlexEnd,
|
||||
Center,
|
||||
Baseline,
|
||||
Stretch
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum FlexItemsAlignment
|
||||
{
|
||||
FlexStart,
|
||||
FlexEnd,
|
||||
Center,
|
||||
Baseline,
|
||||
Stretch
|
||||
}
|
||||
}
|
10
src/Shared/HandyControl_Shared/Data/Flex/FlexOrientation.cs
Normal file
10
src/Shared/HandyControl_Shared/Data/Flex/FlexOrientation.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum FlexOrientation
|
||||
{
|
||||
Row,
|
||||
RowReverse,
|
||||
Column,
|
||||
ColumnReverse
|
||||
}
|
||||
}
|
9
src/Shared/HandyControl_Shared/Data/Flex/FlexWrapping.cs
Normal file
9
src/Shared/HandyControl_Shared/Data/Flex/FlexWrapping.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum FlexWrapping
|
||||
{
|
||||
NoWrap,
|
||||
Wrap,
|
||||
WrapReverse
|
||||
}
|
||||
}
|
@ -44,6 +44,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Notification.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Poptip.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Watermark.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\FlexPanel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\PropertyGrid\Editors\ImagePropertyEditor.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\PropertyGrid\Editors\VerticalAlignmentPropertyEditor.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\PropertyGrid\Editors\HorizontalAlignmentPropertyEditor.cs" />
|
||||
@ -73,6 +74,12 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Text\SimpleText.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Window\GlowWindow.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Collections\DateTimeRangeComparer.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Flex\FlexContentJustify.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Flex\FlexContentAlignment.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Flex\FlexItemAlignment.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Flex\FlexItemsAlignment.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Flex\FlexOrientation.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Flex\FlexWrapping.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Range\DateTimeRange.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\DisposableObject.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\EnumDataProvider.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user