add Card
This commit is contained in:
1 parent
34cc6b9b8b
commit
78c49e7aaf
33 files changed
+412
-28
No files matched your search
@@ -15,6 +15,7 @@
|
||||
<converter:Boolean2StrConverter x:Key="Boolean2StrConverter"/>
|
||||
<converter:Int2StrConverter x:Key="Int2StrConverter"/>
|
||||
<converter:BorderClipConverter x:Key="BorderClipConverter"/>
|
||||
<converter:BorderCircularClipConverter x:Key="BorderCircularClipConverter"/>
|
||||
<converter:BorderCircularConverter x:Key="BorderCircularConverter"/>
|
||||
<converter:Object2VisibilityConverter x:Key="Object2VisibilityConverter"/>
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<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">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="BaseStyle.xaml"/>
|
||||
<ResourceDictionary Source="../../Basic/Converters.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="CardBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="controls:Card">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:Card">
|
||||
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderThickness="0,0,0,1" Visibility="{TemplateBinding Header, Converter={StaticResource Object2VisibilityConverter}}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<ContentPresenter ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" ContentStringFormat="{TemplateBinding HeaderStringFormat}"/>
|
||||
</Border>
|
||||
<ContentPresenter Grid.Row="1"/>
|
||||
<Border Grid.Row="2" BorderThickness="0,1,0,0" Visibility="{TemplateBinding Footer, Converter={StaticResource Object2VisibilityConverter}}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<ContentPresenter ContentSource="Footer" ContentTemplate="{TemplateBinding FooterTemplate}" ContentTemplateSelector="{TemplateBinding FooterTemplateSelector}" ContentStringFormat="{TemplateBinding FooterStringFormat}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -109,7 +109,7 @@
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource BorderCircular}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<Viewbox>
|
||||
<Border x:Name="PART_Clip" Style="{StaticResource BorderClip}" CornerRadius="100" Width="200" Height="200">
|
||||
<Border x:Name="PART_Clip" Style="{StaticResource BorderCircularClip}" CornerRadius="100" Width="200" Height="200">
|
||||
<Path x:Name="PART_Wave" Stroke="{TemplateBinding WaveStroke}" StrokeThickness="{TemplateBinding WaveThickness}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="250" Fill="{TemplateBinding WaveFill}" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" Margin="0,0,-400,-20">
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<Setter Property="controls:BorderElement.Circular" Value="True"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="BorderClip" BasedOn="{StaticResource BorderCircular}" TargetType="Border">
|
||||
<Style x:Key="BorderClip" TargetType="Border">
|
||||
<Setter Property="Clip">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
||||
@@ -42,4 +42,16 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="BorderCircularClip" BasedOn="{StaticResource BorderCircular}" TargetType="Border">
|
||||
<Setter Property="Clip">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource BorderCircularClipConverter}">
|
||||
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
|
||||
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
|
||||
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/>
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,11 @@
|
||||
<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">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Base/CardBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style BasedOn="{StaticResource CardBaseStyle}" TargetType="controls:Card"/>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -14,7 +14,7 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:Gravatar">
|
||||
<Border Style="{StaticResource BorderClip}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<Border Style="{StaticResource BorderCircularClip}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<ContentPresenter Margin="{TemplateBinding Padding}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ListBoxCustom" TargetType="ListBox">
|
||||
<Style x:Key="ListBoxCustom" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemCustom}"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="WrapPanelHorizontalItemsPanelTemplate">
|
||||
<WrapPanel FocusVisualStyle="{x:Null}"/>
|
||||
<WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<Style x:Key="WrapPanelHorizontalListBox" BasedOn="{StaticResource ListBoxCustom}" TargetType="ListBox">
|
||||
@@ -40,7 +40,7 @@
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="WrapPanelVerticalItemsPanelTemplate">
|
||||
<WrapPanel FocusVisualStyle="{x:Null}" Orientation="Vertical"/>
|
||||
<WrapPanel FocusVisualStyle="{x:Null}" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<Style x:Key="WrapPanelVerticalListBox" BasedOn="{StaticResource ListBoxCustom}" TargetType="ListBox">
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
<ResourceDictionary Source="SideMenu.xaml"/>
|
||||
<ResourceDictionary Source="GridSplitter.xaml"/>
|
||||
<ResourceDictionary Source="Col.xaml"/>
|
||||
<ResourceDictionary Source="Card.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -178,7 +178,7 @@
|
||||
</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 Name="UnCheckedElement" Style="{StaticResource BorderCircularClip}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Border.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="1"/>
|
||||
@@ -186,7 +186,7 @@
|
||||
</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 Name="CheckedElement" Style="{StaticResource BorderCircularClip}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Border.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="0"/>
|
||||
|
||||
Reference in new issue
Block a user