Merge branch 'master' into pr/84
No files matched your search
@@ -63,6 +63,26 @@ Step 4:enjoy coding
|
||||
|
||||
## Latest examples
|
||||
|
||||
### ImageBlock
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Magnifier
|
||||
|
||||

|
||||
|
||||
### Card
|
||||
|
||||

|
||||
|
||||
### ButtonGroup
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### Grid
|
||||
|
||||

|
||||
@@ -83,8 +103,6 @@ Step 4:enjoy coding
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### Badge
|
||||
|
||||

|
||||
|
||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 220 KiB |
|
After Width: | Height: | Size: 158 KiB |
|
After Width: | Height: | Size: 373 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 5.9 KiB |
@@ -4,8 +4,6 @@ title: 欢迎来到HandyOrg
|
||||
|
||||
HandyOrg的宗旨是为用户提供最简单的API。
|
||||
|
||||
目前组织成员只有一人。
|
||||
|
||||
我们一直期待着有更多的同学加入。
|
||||
|
||||
我们的入坑要求:
|
||||
|
||||
@@ -29,7 +29,13 @@ title: ComboBox 组合框
|
||||
{% note warning %}
|
||||
标题在左时,为了多个输入框左侧对齐,需要设置标题宽度,标题宽度无需逐个设置,可在外部容器上统一设置。
|
||||
{% endnote %}
|
||||
|
||||
{% note warning %}
|
||||
常见问题:
|
||||
Combobox的字体比原有默认字体大,同时设定标题在左,标题因字体过大显示不全
|
||||

|
||||
解决方案:
|
||||
在该Combobox中添加附加属性`hc:InfoElement.ContentHeight`,默认值为30,默认字体号为12,变更后可根据新的字体大小设定该附加属性的数值,如上图,字体大小为18,则设定`hc:InfoElement.ContentHeight`为38,结果如下:
|
||||
{% endnote %}
|
||||
- 标题在上,带有水印
|
||||
`<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="请输入内容" hc:InfoElement.Title="此项必填" Style="{StaticResource ComboBoxExtend}"/>`
|
||||

|
||||
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -5,12 +5,13 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyName>HandyControlDemo</AssemblyName>
|
||||
<RootNamespace>HandyControlDemo</RootNamespace>
|
||||
<Version>2.0.0</Version>
|
||||
<Version>2.1.0</Version>
|
||||
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
||||
<FileVersion>2.0.0.0</FileVersion>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
<FileVersion>2.1.0.0</FileVersion>
|
||||
<AssemblyVersion>2.1.0.0</AssemblyVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>TRACE;Core</DefineConstants>
|
||||
@@ -352,6 +353,18 @@
|
||||
<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\ButtonGroup_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ButtonGroup_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\VSO_Card_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\VSO_Card_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ImageStack_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ImageStack_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
||||
<Link>Resources\Img\Dance.png</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyName>HandyControl</AssemblyName>
|
||||
<RootNamespace>HandyControl</RootNamespace>
|
||||
<Version>2.0.0</Version>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
<Version>2.1.0</Version>
|
||||
<AssemblyVersion>2.1.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>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>TRACE;Core</DefineConstants>
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
<Setter Property="AllowDrop" Value="true"/>
|
||||
<Setter Property="MinWidth" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="0"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
@@ -467,11 +467,11 @@
|
||||
<!--下拉项基样式-->
|
||||
<Style x:Key="ComboBoxItemBaseStyle" TargetType="ComboBoxItem">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="30"/>
|
||||
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -511,7 +511,7 @@
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="Margin" Value="0,0,4,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -295,13 +295,13 @@
|
||||
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
|
||||
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="1"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding VerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<Grid Grid.Column="1" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding HorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Sizes.xaml"/>
|
||||
<ResourceDictionary Source="Base/ScrollViewerBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -59,7 +60,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="Margin" Value="0,0,0,4"/>
|
||||
<Setter Property="Padding" Value="8,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="MinHeight" Value="44"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<Setter Property="MinWidth" Value="335"/>
|
||||
<Setter Property="MaxWidth" Value="476"/>
|
||||
<Setter Property="MaxHeight" Value="680"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Template">
|
||||
@@ -32,9 +31,6 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel 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"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
@@ -43,8 +39,24 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Name="Icon" Margin="10,0,0,0" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
<TextBlock Name="Title" Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<Image IsHitTestVisible="False" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock.Visibility>
|
||||
<MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
|
||||
<MultiBinding.Bindings>
|
||||
<Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
<Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
|
||||
</MultiBinding.Bindings>
|
||||
</MultiBinding>
|
||||
</TextBlock.Visibility>
|
||||
</TextBlock>
|
||||
<ContentPresenter WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -74,45 +86,9 @@
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Maximized">
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Normal">
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ResizeMode" Value="NoResize">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMin"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ResizeMode" Value="CanMinimize">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<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"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
|
||||
xmlns:tools="https://handyorg.github.io/handycontrol">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
@@ -56,6 +57,8 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowWin10" TargetType="controls:Window">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="#262e2f"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ReverseTextBrush}"/>
|
||||
@@ -68,7 +71,7 @@
|
||||
<Setter Property="CloseButtonHoverForeground" Value="White"/>
|
||||
<Setter Property="OtherButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="OtherButtonForeground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="#e5e5e5"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkMaskBrush}"/>
|
||||
<Setter Property="OtherButtonHoverForeground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -96,8 +99,24 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Name="Icon" Margin="10,0,0,0" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
<TextBlock Name="Title" Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<Image IsHitTestVisible="False" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock.Visibility>
|
||||
<MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
|
||||
<MultiBinding.Bindings>
|
||||
<Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
<Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
|
||||
</MultiBinding.Bindings>
|
||||
</MultiBinding>
|
||||
</TextBlock.Visibility>
|
||||
</TextBlock>
|
||||
<ContentPresenter WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -112,11 +131,8 @@
|
||||
<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"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Maximized">
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="Padding" Value="{x:Static tools:VisualHelper.WindowMaximizedPadding}"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
@@ -134,23 +150,20 @@
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -26,6 +26,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -72,15 +73,6 @@
|
||||
<Compile Include="..\..\Shared\HandyControlDemo_Shared\Properties\AssemblyInfo.cs">
|
||||
<Link>Properties\AssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Main\NoUserContent.xaml.cs">
|
||||
<DependentUpon>NoUserContent.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="UserControl\Main\NoUserContent.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.Designer.cs">
|
||||
@@ -395,6 +387,18 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
||||
<Link>Resources\Img\Dance.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ImageStack_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ImageStack_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\VSO_Card_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\VSO_Card_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ButtonGroup_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ButtonGroup_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>
|
||||
@@ -423,6 +427,7 @@
|
||||
<Link>Resources\Img\LeftMainContent\RepeatButton_16x.png</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,111 +0,0 @@
|
||||
<Grid x:Class="HandyControlDemo.UserControl.NoUserContent"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
Height="29"
|
||||
DataContext="{Binding NoUser,Source={StaticResource Locator}}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="Stretch" Orientation="Horizontal">
|
||||
<Button Margin="4,0,0,0" Width="28" Height="29" Style="{StaticResource ButtonCustom}">
|
||||
<hc:Interaction.Triggers>
|
||||
<hc:EventTrigger EventName="Click">
|
||||
<hc:InvokeCommandAction Command="{x:Static shell:SystemCommands.ShowSystemMenuCommand}" />
|
||||
</hc:EventTrigger>
|
||||
<hc:EventTrigger EventName="MouseDoubleClick">
|
||||
<hc:InvokeCommandAction Command="{x:Static shell:SystemCommands.CloseWindowCommand}" />
|
||||
</hc:EventTrigger>
|
||||
</hc:Interaction.Triggers>
|
||||
<Path Height="16" Fill="White" Stretch="Uniform" Data="{StaticResource LogoGeometry}"/>
|
||||
</Button>
|
||||
<Menu Margin="10,0,0,0" Background="Transparent">
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.Repository}">
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/NaBian/HandyControl" Header="GitHub">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource GithubGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.nuget.org/packages/HandyControl" Header="NuGet">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource NugetGeometry}" Fill="#30a5dd"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.About}">
|
||||
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ContributorsView}" Header="{x:Static langs:Lang.Contributors}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ContributorsGeometry}" Fill="#ef6c00"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.QQGroupView}" Header="{x:Static langs:Lang.QQGroup}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource QqGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="mailto:836904362@qq.com" Header="{x:Static langs:Lang.Email}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource EmailGeometry}" Fill="{DynamicResource WarningBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://gitter.im/HandyControl/Lobby" Header="{x:Static langs:Lang.Chatroom}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource GitterGeometry}" Fill="#e52e64"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.cnblogs.com/nabian" Header="{x:Static langs:Lang.Blog}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource CnblogsGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static langs:Lang.About}" Click="MenuAbout_OnClick">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource InfoGeometry}" Fill="{DynamicResource SuccessBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.Recommendation}">
|
||||
<MenuItem Header="{x:Static langs:Lang.Project}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ProjectsView}" >
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ProjectGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static langs:Lang.Blog}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.BlogsView}" >
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource BlogGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
|
||||
<Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-25" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Button.Click="ButtonLangs_OnClick" Margin="10,10,0,10">
|
||||
<Button Tag="zh-cn" Style="{StaticResource ButtonCustom}">
|
||||
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/cn.png"/>
|
||||
</Button>
|
||||
<Button Tag="en" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/en.png"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Button.Click="ButtonSkins_OnClick" Margin="10,10,10,10">
|
||||
<Button Tag="{x:Static hc:SkinType.Default}" Style="{StaticResource ButtonCustom}">
|
||||
<Border Background="White" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
<Button Tag="{x:Static hc:SkinType.Dark}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Border Background="Black" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
<Button Tag="{x:Static hc:SkinType.Violet}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Border Background="DarkViolet" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
@@ -1,61 +0,0 @@
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class NoUserContent
|
||||
{
|
||||
public NoUserContent()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is string tag)
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (tag.Equals(GlobalData.Config.Lang)) return;
|
||||
Growl.Ask(Properties.Langs.Lang.ChangeLangAsk, b =>
|
||||
{
|
||||
if (!b) return true;
|
||||
GlobalData.Config.Lang = tag;
|
||||
GlobalData.Save();
|
||||
var processModule = Process.GetCurrentProcess().MainModule;
|
||||
if (processModule != null)
|
||||
Process.Start(processModule.FileName);
|
||||
Application.Current.Shutdown();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonConfig_OnClick(object sender, RoutedEventArgs e) => PopupConfig.IsOpen = true;
|
||||
|
||||
private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is SkinType tag)
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (tag.Equals(GlobalData.Config.Skin)) return;
|
||||
GlobalData.Config.Skin = tag;
|
||||
GlobalData.Save();
|
||||
((App)Application.Current).UpdateSkin(tag);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuAbout_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
new AboutWindow
|
||||
{
|
||||
Owner = Application.Current.MainWindow
|
||||
}.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -23,6 +23,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../../Basic/Sizes.xaml"/>
|
||||
<ResourceDictionary Source="../../Basic/Geometries.xaml"/>
|
||||
<ResourceDictionary Source="../../Basic/Converters.xaml"/>
|
||||
<ResourceDictionary Source="../TextBlock.xaml"/>
|
||||
@@ -237,7 +238,7 @@
|
||||
<Setter Property="AllowDrop" Value="true"/>
|
||||
<Setter Property="MinWidth" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="0"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
@@ -425,11 +426,11 @@
|
||||
<!--下拉项基样式-->
|
||||
<Style x:Key="ComboBoxItemBaseStyle" TargetType="ComboBoxItem">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="30"/>
|
||||
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -463,17 +464,17 @@
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource ComboBoxItemBaseStyle}"/>
|
||||
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||
<Setter Property="controls:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="Template" Value="{StaticResource ComboBoxTemplate}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Style.Triggers>
|
||||
@@ -489,7 +490,7 @@
|
||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
||||
<Setter Property="Template" Value="{StaticResource ComboBoxTopTemplate}"/>
|
||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||
<Setter Property="controls:InfoElement.ContentHeight" Value="30.0"/>
|
||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="Margin" Value="0,0,4,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -296,13 +296,13 @@
|
||||
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
|
||||
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="1"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding VerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<Grid Grid.Column="1" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding HorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Sizes.xaml"/>
|
||||
<ResourceDictionary Source="Base/ScrollViewerBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -58,7 +59,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="Margin" Value="0,0,0,4"/>
|
||||
<Setter Property="Padding" Value="8,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="MinHeight" Value="44"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<Setter Property="MinWidth" Value="335"/>
|
||||
<Setter Property="MaxWidth" Value="476"/>
|
||||
<Setter Property="MaxHeight" Value="680"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Template">
|
||||
@@ -33,9 +32,6 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel 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"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="shell:SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
@@ -44,9 +40,25 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Name="Icon" Margin="10,0,0,0" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
<TextBlock Name="Title" Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<ContentPresenter shell:WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
|
||||
<Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static shell:SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" shell:WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static shell:SystemCommands.CloseWindowCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<Image IsHitTestVisible="False" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock.Visibility>
|
||||
<MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
|
||||
<MultiBinding.Bindings>
|
||||
<Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
<Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
|
||||
</MultiBinding.Bindings>
|
||||
</MultiBinding>
|
||||
</TextBlock.Visibility>
|
||||
</TextBlock>
|
||||
<ContentPresenter shell:WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
@@ -75,45 +87,9 @@
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Maximized">
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Normal">
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ResizeMode" Value="NoResize">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMin"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ResizeMode" Value="CanMinimize">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
|
||||
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell">
|
||||
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
|
||||
xmlns:tools="clr-namespace:HandyControl.Tools">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
@@ -57,6 +58,8 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowWin10" BasedOn="{x:Null}" TargetType="controls:Window">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="#262e2f"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
@@ -68,7 +71,7 @@
|
||||
<Setter Property="CloseButtonHoverForeground" Value="White"/>
|
||||
<Setter Property="OtherButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="OtherButtonForeground" Value="{DynamicResource ReverseTextBrush}"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="#e5e5e5"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkMaskBrush}"/>
|
||||
<Setter Property="OtherButtonHoverForeground" Value="{DynamicResource ReverseTextBrush}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -96,8 +99,24 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Name="Icon" Margin="10,0,0,0" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
<TextBlock Name="Title" Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static shell:SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" shell:WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static shell:SystemCommands.CloseWindowCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<Image IsHitTestVisible="False" Name="Icon" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock.Visibility>
|
||||
<MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
|
||||
<MultiBinding.Bindings>
|
||||
<Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
<Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
|
||||
</MultiBinding.Bindings>
|
||||
</MultiBinding>
|
||||
</TextBlock.Visibility>
|
||||
</TextBlock>
|
||||
<ContentPresenter shell:WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -112,11 +131,8 @@
|
||||
<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"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Maximized">
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="Padding" Value="{x:Static tools:VisualHelper.WindowMaximizedPadding}"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
@@ -134,23 +150,20 @@
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -60,6 +60,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -148,9 +149,6 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Lang.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Main\NoUserContent.xaml.cs">
|
||||
<DependentUpon>NoUserContent.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\1.jpg">
|
||||
@@ -430,12 +428,6 @@
|
||||
<Link>Resources\Img\under_construction.gif</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="UserControl\Main\NoUserContent.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
|
||||
<Link>Properties\Langs\Lang.en.resx</Link>
|
||||
@@ -457,6 +449,18 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
||||
<Link>Resources\Img\Dance.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ImageStack_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ImageStack_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\VSO_Card_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\VSO_Card_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ButtonGroup_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ButtonGroup_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>
|
||||
@@ -487,6 +491,7 @@
|
||||
<Link>Resources\fabric-icons.ttf</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,110 +0,0 @@
|
||||
<Grid x:Class="HandyControlDemo.UserControl.NoUserContent"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
Height="29"
|
||||
DataContext="{Binding NoUser,Source={StaticResource Locator}}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="Stretch" Orientation="Horizontal">
|
||||
<Button Margin="4,0,0,0" Width="28" Height="29" Style="{StaticResource ButtonCustom}">
|
||||
<hc:Interaction.Triggers>
|
||||
<hc:EventTrigger EventName="Click">
|
||||
<hc:InvokeCommandAction Command="{x:Static SystemCommands.ShowSystemMenuCommand}" />
|
||||
</hc:EventTrigger>
|
||||
<hc:EventTrigger EventName="MouseDoubleClick">
|
||||
<hc:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
||||
</hc:EventTrigger>
|
||||
</hc:Interaction.Triggers>
|
||||
<Path Height="16" Fill="White" Stretch="Uniform" Data="{StaticResource LogoGeometry}"/>
|
||||
</Button>
|
||||
<Menu Margin="10,0,0,0" Background="Transparent">
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.Repository}">
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/NaBian/HandyControl" Header="GitHub">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource GithubGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.nuget.org/packages/HandyControl" Header="NuGet">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource NugetGeometry}" Fill="#30a5dd"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.About}">
|
||||
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ContributorsView}" Header="{x:Static langs:Lang.Contributors}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ContributorsGeometry}" Fill="#ef6c00"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.QQGroupView}" Header="{x:Static langs:Lang.QQGroup}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource QqGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="mailto:836904362@qq.com" Header="{x:Static langs:Lang.Email}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource EmailGeometry}" Fill="{DynamicResource WarningBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://gitter.im/HandyControl/Lobby" Header="{x:Static langs:Lang.Chatroom}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource GitterGeometry}" Fill="#e52e64"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.cnblogs.com/nabian" Header="{x:Static langs:Lang.Blog}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource CnblogsGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static langs:Lang.About}" Click="MenuAbout_OnClick">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource InfoGeometry}" Fill="{DynamicResource SuccessBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.Recommendation}">
|
||||
<MenuItem Header="{x:Static langs:Lang.Project}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ProjectsView}" >
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ProjectGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static langs:Lang.Blog}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.BlogsView}" >
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource BlogGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
|
||||
<Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-25" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Button.Click="ButtonLangs_OnClick" Margin="10,10,0,10">
|
||||
<Button Tag="zh-cn" Style="{StaticResource ButtonCustom}">
|
||||
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/cn.png"/>
|
||||
</Button>
|
||||
<Button Tag="en" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/en.png"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Button.Click="ButtonSkins_OnClick" Margin="10,10,10,10">
|
||||
<Button Tag="{x:Static hc:SkinType.Default}" Style="{StaticResource ButtonCustom}">
|
||||
<Border Background="White" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
<Button Tag="{x:Static hc:SkinType.Dark}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Border Background="Black" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
<Button Tag="{x:Static hc:SkinType.Violet}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Border Background="DarkViolet" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
@@ -1,60 +0,0 @@
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class NoUserContent
|
||||
{
|
||||
public NoUserContent()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is string tag)
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (tag.Equals(GlobalData.Config.Lang)) return;
|
||||
Growl.Ask(Properties.Langs.Lang.ChangeLangAsk, b =>
|
||||
{
|
||||
if (!b) return true;
|
||||
GlobalData.Config.Lang = tag;
|
||||
GlobalData.Save();
|
||||
var processModule = Process.GetCurrentProcess().MainModule;
|
||||
if (processModule != null)
|
||||
Process.Start(processModule.FileName);
|
||||
Application.Current.Shutdown();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonConfig_OnClick(object sender, RoutedEventArgs e) => PopupConfig.IsOpen = true;
|
||||
|
||||
private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is SkinType tag)
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (tag.Equals(GlobalData.Config.Skin)) return;
|
||||
GlobalData.Config.Skin = tag;
|
||||
GlobalData.Save();
|
||||
((App)Application.Current).UpdateSkin(tag);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuAbout_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
new AboutWindow
|
||||
{
|
||||
Owner = Application.Current.MainWindow
|
||||
}.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -58,6 +58,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
<Setter Property="AllowDrop" Value="true"/>
|
||||
<Setter Property="MinWidth" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="0"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
@@ -467,11 +467,11 @@
|
||||
<!--下拉项基样式-->
|
||||
<Style x:Key="ComboBoxItemBaseStyle" TargetType="ComboBoxItem">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="30"/>
|
||||
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -511,7 +511,7 @@
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="10,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="Margin" Value="0,0,4,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -295,13 +295,13 @@
|
||||
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
|
||||
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="1"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding VerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<Grid Grid.Column="1" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding HorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Sizes.xaml"/>
|
||||
<ResourceDictionary Source="Base/ScrollViewerBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -59,7 +60,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="Margin" Value="0,0,0,4"/>
|
||||
<Setter Property="Padding" Value="8,6"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||
<Setter Property="MinHeight" Value="44"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<Setter Property="MinWidth" Value="335"/>
|
||||
<Setter Property="MaxWidth" Value="476"/>
|
||||
<Setter Property="MaxHeight" Value="680"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Template">
|
||||
@@ -32,9 +31,6 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel 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"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
@@ -43,8 +39,24 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Name="Icon" Margin="10,0,0,0" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
<TextBlock Name="Title" Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<Image IsHitTestVisible="False" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock.Visibility>
|
||||
<MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
|
||||
<MultiBinding.Bindings>
|
||||
<Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
<Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
|
||||
</MultiBinding.Bindings>
|
||||
</MultiBinding>
|
||||
</TextBlock.Visibility>
|
||||
</TextBlock>
|
||||
<ContentPresenter WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -74,45 +86,9 @@
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Maximized">
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Normal">
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ResizeMode" Value="NoResize">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMin"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ResizeMode" Value="CanMinimize">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<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"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
|
||||
xmlns:tools="clr-namespace:HandyControl.Tools">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
@@ -56,6 +57,8 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowWin10" TargetType="controls:Window">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="#262e2f"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ReverseTextBrush}"/>
|
||||
@@ -68,7 +71,7 @@
|
||||
<Setter Property="CloseButtonHoverForeground" Value="White"/>
|
||||
<Setter Property="OtherButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="OtherButtonForeground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="#e5e5e5"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkMaskBrush}"/>
|
||||
<Setter Property="OtherButtonHoverForeground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -96,8 +99,24 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Name="Icon" Margin="10,0,0,0" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
<TextBlock Name="Title" Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<Image IsHitTestVisible="False" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock.Visibility>
|
||||
<MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
|
||||
<MultiBinding.Bindings>
|
||||
<Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
<Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
|
||||
</MultiBinding.Bindings>
|
||||
</MultiBinding>
|
||||
</TextBlock.Visibility>
|
||||
</TextBlock>
|
||||
<ContentPresenter WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -112,11 +131,8 @@
|
||||
<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"/>
|
||||
</Trigger>
|
||||
<Trigger Property="WindowState" Value="Maximized">
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="Padding" Value="{x:Static tools:VisualHelper.WindowMaximizedPadding}"/>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
@@ -134,23 +150,20 @@
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
|
||||
@@ -100,6 +100,14 @@
|
||||
|
||||
public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
|
||||
|
||||
public static readonly string ButtonGroupDemoCtl = nameof(ButtonGroupDemoCtl);
|
||||
|
||||
public static readonly string CardDemoCtl = nameof(CardDemoCtl);
|
||||
|
||||
public static readonly string MagnifierDemoCtl = nameof(MagnifierDemoCtl);
|
||||
|
||||
public static readonly string ImageBlockDemoCtl = nameof(ImageBlockDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
||||
|
||||
@@ -52,7 +52,11 @@ var controlList = new List<string>
|
||||
"SideMenuDemoCtl",
|
||||
"GridDemoCtl",
|
||||
"PoptipDemoCtl",
|
||||
"RangeSliderDemoCtl"
|
||||
"RangeSliderDemoCtl",
|
||||
"ButtonGroupDemoCtl",
|
||||
"CardDemoCtl",
|
||||
"MagnifierDemoCtl",
|
||||
"ImageBlockDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace HandyControlDemo.Data
|
||||
{
|
||||
public class CardModel
|
||||
{
|
||||
public string Header { get; set; }
|
||||
|
||||
public string Content { get; set; }
|
||||
|
||||
public string Footer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\AppConfig.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\DemoType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\GlobalData.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CardModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\ChatInfoModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\AvatarModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CoverViewDemoModel.cs" />
|
||||
@@ -25,7 +26,7 @@
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Service\DataService.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Service\Data\DataService.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\String2BrushConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\StringRepeatConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\AssemblyHelper.cs" />
|
||||
@@ -44,9 +45,21 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialog.xaml.cs">
|
||||
<DependentUpon>TextDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialogWithTimer.xaml.cs">
|
||||
<DependentUpon>TextDialogWithTimer.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
|
||||
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml.cs">
|
||||
<DependentUpon>CardDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageBlockDemoCtl.xaml.cs">
|
||||
<DependentUpon>ImageBlockDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\MagnifierDemoCtl.xaml.cs">
|
||||
<DependentUpon>MagnifierDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RangeSliderDemoCtl.xaml.cs">
|
||||
<DependentUpon>RangeSliderDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -56,6 +69,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\BadgeDemoCtl.xaml.cs">
|
||||
<DependentUpon>BadgeDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ButtonGroupDemoCtl.xaml.cs">
|
||||
<DependentUpon>ButtonGroupDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml.cs">
|
||||
<DependentUpon>CalendarWithClockDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -189,6 +205,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\BlogsView.xaml.cs">
|
||||
<DependentUpon>BlogsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\NoUserContent.xaml.cs">
|
||||
<DependentUpon>NoUserContent.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\ProjectsView.xaml.cs">
|
||||
<DependentUpon>ProjectsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -295,6 +314,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Basic\InteractiveDialogViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\BadgeDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CardDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CoverViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\DialogDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\GrowlDemoViewModel.cs" />
|
||||
@@ -398,10 +418,26 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialogWithTimer.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageBlockDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\MagnifierDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\RelativePanelDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -414,6 +450,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ButtonGroupDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -594,6 +634,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Main\NoUserContent.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Main\ProjectsView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -766,8 +810,6 @@
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="C:\Users\Mahdi\Documents\GitHub\HandyControl\src\Shared\HandyControlDemo_Shared\UserControl\Controls\PoptipDemoCtl.xaml.cs">
|
||||
<DependentUpon>PoptipDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Folder Include="$(MSBuildThisFileDirectory)Service\Data\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>c4694269-c9b8-45d5-87f8-d0088c532510</ProjectGuid>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
|
||||
@@ -1,28 +1,23 @@
|
||||
<hc:BlurWindow x:Class="HandyControlDemo.MainWindow"
|
||||
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"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
mc:Ignorable="d"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#262e2f"
|
||||
NonClientAreaBackground="#262e2f"
|
||||
OtherButtonHoverBackground="#888580"
|
||||
CloseButtonForeground="White"
|
||||
OtherButtonHoverForeground="White"
|
||||
OtherButtonForeground="White"
|
||||
Style="{StaticResource WindowBlur}"
|
||||
Title="MainWindow"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Name="MyWindow"
|
||||
DataContext="{Binding Main,Source={StaticResource Locator}}"
|
||||
hc:Dialog.Token="{x:Static data:MessageToken.MainWindow}"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="1400">
|
||||
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"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
mc:Ignorable="d"
|
||||
Style="{StaticResource WindowBlur}"
|
||||
Title="HandyControlDemo"
|
||||
ShowTitle="False"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
hc:GlobalShortcut.Host="True"
|
||||
DataContext="{Binding Main,Source={StaticResource Locator}}"
|
||||
hc:Dialog.Token="{x:Static data:MessageToken.MainWindow}"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="1400"
|
||||
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
|
||||
<hc:GlobalShortcut.KeyBindings>
|
||||
<KeyBinding Modifiers="Control+Alt" Key="I" Command="{Binding Main.GlobalShortcutInfoCmd, Source={StaticResource Locator}}"/>
|
||||
<KeyBinding Modifiers="Control+Alt" Key="E" Command="{Binding Main.GlobalShortcutWarningCmd, Source={StaticResource Locator}}"/>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.ComponentModel;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Tools;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Tools;
|
||||
|
||||
@@ -22,8 +21,6 @@ namespace HandyControlDemo
|
||||
Messenger.Default.Send<object>(null, MessageToken.ClearLeftSelected);
|
||||
Messenger.Default.Send(true, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.OverView}"), MessageToken.LoadShowContent);
|
||||
|
||||
GlobalShortcut.Init(this);
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
|
||||
@@ -13,5 +13,5 @@ using System.Windows;
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
[assembly: AssemblyVersion("2.0.0")]
|
||||
[assembly: AssemblyVersion("2.1.0")]
|
||||
#endif
|
||||
@@ -178,7 +178,16 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 日历.
|
||||
/// 查找类似 按钮组 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string ButtonGroup {
|
||||
get {
|
||||
return ResourceManager.GetString("ButtonGroup", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 日历 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Calendar {
|
||||
get {
|
||||
@@ -196,7 +205,16 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 轮播.
|
||||
/// 查找类似 卡片 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Card {
|
||||
get {
|
||||
return ResourceManager.GetString("Card", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 轮播 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Carousel {
|
||||
get {
|
||||
@@ -673,7 +691,16 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 图片浏览器.
|
||||
/// 查找类似 图片块 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string ImageBlock {
|
||||
get {
|
||||
return ResourceManager.GetString("ImageBlock", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 图片浏览器 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string ImageBrowser {
|
||||
get {
|
||||
@@ -754,7 +781,16 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 菜单.
|
||||
/// 查找类似 放大镜 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Magnifier {
|
||||
get {
|
||||
return ResourceManager.GetString("Magnifier", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 菜单 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Menu {
|
||||
get {
|
||||
@@ -1097,8 +1133,7 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 注册.
|
||||
/// 查找类似 推荐 的本地化字符串。
|
||||
/// 查找类似 群友推荐 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Recommendation {
|
||||
get {
|
||||
@@ -1368,7 +1403,16 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 时间条.
|
||||
/// 查找类似 文本对话框,带计时器 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TextDialogWithTimer {
|
||||
get {
|
||||
return ResourceManager.GetString("TextDialogWithTimer", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 时间条 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TimeBar {
|
||||
get {
|
||||
|
||||
@@ -621,4 +621,19 @@
|
||||
<data name="Off" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
<data name="ButtonGroup" xml:space="preserve">
|
||||
<value>ButtonGroup</value>
|
||||
</data>
|
||||
<data name="Card" xml:space="preserve">
|
||||
<value>Card</value>
|
||||
</data>
|
||||
<data name="TextDialogWithTimer" xml:space="preserve">
|
||||
<value>TextDialog with timer</value>
|
||||
</data>
|
||||
<data name="Magnifier" xml:space="preserve">
|
||||
<value>Magnifier</value>
|
||||
</data>
|
||||
<data name="ImageBlock" xml:space="preserve">
|
||||
<value>ImageBlock</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -604,7 +604,7 @@
|
||||
<value>Poptip</value>
|
||||
</data>
|
||||
<data name="Recommendation" xml:space="preserve">
|
||||
<value>推荐</value>
|
||||
<value>群友推荐</value>
|
||||
</data>
|
||||
<data name="Project" xml:space="preserve">
|
||||
<value>项目</value>
|
||||
@@ -621,4 +621,19 @@
|
||||
<data name="Off" xml:space="preserve">
|
||||
<value>关</value>
|
||||
</data>
|
||||
<data name="ButtonGroup" xml:space="preserve">
|
||||
<value>按钮组</value>
|
||||
</data>
|
||||
<data name="Card" xml:space="preserve">
|
||||
<value>卡片</value>
|
||||
</data>
|
||||
<data name="TextDialogWithTimer" xml:space="preserve">
|
||||
<value>文本对话框,带计时器</value>
|
||||
</data>
|
||||
<data name="Magnifier" xml:space="preserve">
|
||||
<value>放大镜</value>
|
||||
</data>
|
||||
<data name="ImageBlock" xml:space="preserve">
|
||||
<value>图片块</value>
|
||||
</data>
|
||||
</root>
|
||||
|
After Width: | Height: | Size: 617 KiB |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 165 B |
@@ -76,18 +76,7 @@
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate">
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<hc:Interaction.Behaviors>
|
||||
<hc:FluidMoveBehavior AppliesTo="Children" Duration="0:0:.2">
|
||||
<hc:FluidMoveBehavior.EaseX>
|
||||
<PowerEase/>
|
||||
</hc:FluidMoveBehavior.EaseX>
|
||||
<hc:FluidMoveBehavior.EaseY>
|
||||
<PowerEase/>
|
||||
</hc:FluidMoveBehavior.EaseY>
|
||||
</hc:FluidMoveBehavior>
|
||||
</hc:Interaction.Behaviors>
|
||||
</WrapPanel>
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<Style x:Key="MessageBoxCustom" TargetType="hc:MessageBox" BasedOn="{StaticResource {x:Type hc:MessageBox}}">
|
||||
@@ -97,6 +86,7 @@
|
||||
<Setter Property="OtherButtonHoverForeground" Value="White"/>
|
||||
<Setter Property="NonClientAreaForeground" Value="White"/>
|
||||
<Setter Property="CloseButtonForeground" Value="White"/>
|
||||
<Setter Property="Icon" Value="/HandyControlDemo;component/Resources/Img/icon.ico"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TextBlockFabricIcons" TargetType="TextBlock">
|
||||
|
||||
@@ -116,6 +116,18 @@ namespace HandyControlDemo.Service
|
||||
DisplayName = "吕毅",
|
||||
AvatarUri = "https://avatars2.githubusercontent.com/u/9959623?s=400&v=4",
|
||||
Link = "https://blog.walterlv.com/"
|
||||
},
|
||||
new AvatarModel
|
||||
{
|
||||
DisplayName = "DinoChan",
|
||||
AvatarUri = "https://avatars1.githubusercontent.com/u/6076257?s=400&v=4",
|
||||
Link = "https://www.cnblogs.com/dino623/"
|
||||
},
|
||||
new AvatarModel
|
||||
{
|
||||
DisplayName = "noctwolf",
|
||||
AvatarUri = "https://avatars3.githubusercontent.com/u/21022467?s=400&v=4",
|
||||
Link = "https://www.cnblogs.com/noctwolf/"
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -145,6 +157,73 @@ namespace HandyControlDemo.Service
|
||||
};
|
||||
}
|
||||
|
||||
internal List<CardModel> GetCardDataList()
|
||||
{
|
||||
return new List<CardModel>
|
||||
{
|
||||
new CardModel
|
||||
{
|
||||
Header = "Atomic",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/1.jpg",
|
||||
Footer = "Stive Morgan"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Zinderlong",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/2.jpg",
|
||||
Footer = "Zonderling"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Busy Doin' Nothin'",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/3.jpg",
|
||||
Footer = "Ace Wilder"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Wrong",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/4.jpg",
|
||||
Footer = "Blaxy Girls"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "The Lights",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/5.jpg",
|
||||
Footer = "Panda Eyes"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "EA7-50-Cent Disco",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/6.jpg",
|
||||
Footer = "еяхат музыка"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Monsters",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/7.jpg",
|
||||
Footer = "Different Heaven"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Gangsta Walk",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/8.jpg",
|
||||
Footer = "Illusionize"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Won't Back Down",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/9.jpg",
|
||||
Footer = "Boehm / Benjamin Francis Leftwich"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Katchi",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/10.jpg",
|
||||
Footer = "Ofenbach / Nick Waterhouse"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
internal List<StepBarDemoModel> GetStepBarDemoDataList()
|
||||
{
|
||||
return new List<StepBarDemoModel>
|
||||
@@ -37,7 +37,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToggleButton Name="ToggleButtonAudio" hc:BorderElement.CornerRadius="15" Width="30" Height="30" Padding="7" Margin="6" hc:IconSwitchElement.Geometry="{StaticResource AudioGeometry}" hc:IconSwitchElement.GeometrySelected="{StaticResource KeyboardGeometry}" Style="{StaticResource ToggleButtonIcon}"/>
|
||||
<Button Command="{Binding OpenImageCmd}" Grid.Column="2" Margin="6,0,6,0" hc:BorderElement.CornerRadius="15" Width="30" Height="30" Padding="7" hc:IconElement.Geometry="{StaticResource ImageGeometry}"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding ChatString,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsChecked,ElementName=ToggleButtonAudio,Converter={StaticResource Boolean2VisibilityReConverter}}">
|
||||
<TextBox VerticalAlignment="Center" Grid.Column="1" Text="{Binding ChatString,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsChecked,ElementName=ToggleButtonAudio,Converter={StaticResource Boolean2VisibilityReConverter}}">
|
||||
<hc:Interaction.Triggers>
|
||||
<hc:EventTrigger EventName="KeyDown">
|
||||
<hc:EventToCommand Command="{Binding SendStringCmd}" PassEventArgsToCommand="True" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Border x:Class="HandyControlDemo.UserControl.Basic.InteractiveDialog"
|
||||
<Border x:Class="HandyControlDemo.UserControl.InteractiveDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace HandyControlDemo.UserControl.Basic
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class InteractiveDialog
|
||||
{
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<Border x:Class="HandyControlDemo.UserControl.TextDialogWithTimer"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
CornerRadius="10"
|
||||
Width="400"
|
||||
Height="247"
|
||||
DataContext="{Binding InteractiveDialog, Source={StaticResource Locator}}"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:SimplePanel>
|
||||
<Viewbox Width="80" Height="80">
|
||||
<TextBlock TextWrapping="Wrap" Style="{StaticResource TextBlockLargeBold}" Text="{x:Static langs:Lang.PleaseWait}"/>
|
||||
</Viewbox>
|
||||
<Button Name="ButtonClose" Width="22" Height="22" Command="{Binding CloseCmd}" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
||||
<hc:CircleProgressBar Name="ProgressBarTimer" ShowText="False" Width="120" Height="120"/>
|
||||
</hc:SimplePanel>
|
||||
</Border>
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class TextDialogWithTimer
|
||||
{
|
||||
public TextDialogWithTimer()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var animation = AnimationHelper.CreateAnimation(100, 5000);
|
||||
animation.EasingFunction = null;
|
||||
animation.Completed += Animation_Completed;
|
||||
ProgressBarTimer.BeginAnimation(RangeBase.ValueProperty, animation);
|
||||
}
|
||||
|
||||
private void Animation_Completed(object sender, EventArgs e)
|
||||
{
|
||||
ButtonClose.Command.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.ButtonGroupDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs">
|
||||
<hc:TransitioningContentControl>
|
||||
<WrapPanel Margin="16" VerticalAlignment="Center">
|
||||
<StackPanel Margin="16">
|
||||
<hc:ButtonGroup>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,32,0,0">
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,32,0,0" Style="{StaticResource ButtonGroupSolid}">
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,32,0,0">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
</hc:ButtonGroup>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="16" Orientation="Horizontal">
|
||||
<hc:ButtonGroup Orientation="Vertical">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="32,0,0,0" Style="{StaticResource ButtonGroupSolid}" Orientation="Vertical">
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
</hc:ButtonGroup>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ButtonGroupDemoCtl
|
||||
{
|
||||
public ButtonGroupDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
|
||||
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
|
||||
|
||||
public BitmapFrame Source
|
||||
{
|
||||
get => (BitmapFrame) GetValue(SourceProperty);
|
||||
set => SetValue(SourceProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
|
||||
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get => (string) GetValue(UserNameProperty);
|
||||
set => SetValue(UserNameProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
|
||||
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||
|
||||
public string Link
|
||||
{
|
||||
get => (string) GetValue(LinkProperty);
|
||||
set => SetValue(LinkProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.CardDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
DataContext="{Binding CardDemo,Source={StaticResource Locator}}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data">
|
||||
<hc:TransitioningContentControl>
|
||||
<ListBox Margin="32" BorderThickness="0" Style="{StaticResource WrapPanelHorizontalListBox}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}" ItemsSource="{Binding DataList}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="data:CardModel">
|
||||
<hc:Card MaxWidth="240" BorderThickness="0" Effect="{StaticResource EffectShadow2}" Margin="8" Footer="{Binding Footer}">
|
||||
<!--<hc:Card.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock HorizontalAlignment="Left" Style="{StaticResource TextBlockLargeBold}" Text="{Binding}" Margin="10"/>
|
||||
</DataTemplate>
|
||||
</hc:Card.HeaderTemplate>-->
|
||||
<Border CornerRadius="4,4,0,0" Style="{StaticResource BorderClip}">
|
||||
<Image Width="240" Height="240" Source="{Binding Content}" Stretch="Uniform"/>
|
||||
</Border>
|
||||
<hc:Card.FooterTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="10">
|
||||
<TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Style="{StaticResource TextBlockLargeBold}" Text="{Binding DataContext.Header,RelativeSource={RelativeSource AncestorType=hc:Card}}" HorizontalAlignment="Left"/>
|
||||
<TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Style="{StaticResource TextBlockDefault}" Text="{Binding}" Margin="0,6,0,0" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</hc:Card.FooterTemplate>
|
||||
</hc:Card>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CardDemoCtl
|
||||
{
|
||||
public CardDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32" VerticalAlignment="Center">
|
||||
<Button Content="{x:Static langs:Lang.TextDialog}" Command="{Binding ShowTextCmd}" />
|
||||
<Button Margin="0,32,0,0" Content="{x:Static langs:Lang.TextDialogWithTimer}" Command="{Binding ShowInteractiveDialogCmd}" CommandParameter="True"/>
|
||||
<TextBox Margin="0,32,0,0" Text="{Binding DialogResult,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxExtend}" hc:InfoElement.Placeholder="{x:Static langs:Lang.PleaseInput}"/>
|
||||
<Button Margin="0,10,0,0" Content="{x:Static langs:Lang.InteractiveDialog}" Command="{Binding ShowInteractiveDialogCmd}"/>
|
||||
<Button Margin="0,32,0,0" Content="{x:Static langs:Lang.NewWindow}" Command="{Binding NewWindowCmd}"/>
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:TransitioningContentControl>
|
||||
<hc:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300">
|
||||
<hc:GifImage.Source>
|
||||
<BitmapImage UriSource="/HandyControlDemo;component/Resources/Img/car_chase.gif"/>
|
||||
</hc:GifImage.Source>
|
||||
</hc:GifImage>
|
||||
<hc:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300" Uri="/HandyControlDemo;component/Resources/Img/car_chase.gif"/>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.ImageBlockDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||
<hc:TransitioningContentControl>
|
||||
<UniformGrid Rows="3" Columns="4" Margin="32">
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="0" EndColumn="7" EndRow="0" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="1" EndColumn="7" EndRow="1" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="2" EndColumn="7" EndRow="2" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="3" EndColumn="7" EndRow="3" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.1" Columns="8" Rows="10" StartColumn="0" StartRow="4" EndColumn="7" EndRow="4" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="5" EndColumn="7" EndRow="5" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="6" EndColumn="7" EndRow="6" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.1" Columns="8" Rows="10" StartColumn="0" StartRow="7" EndColumn="7" EndRow="7" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="8" EndColumn="7" EndRow="8" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="9" EndColumn="7" EndRow="9" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
|
||||
</UniformGrid>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ImageBlockDemoCtl
|
||||
{
|
||||
public ImageBlockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.MagnifierDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||
<hc:TransitioningContentControl>
|
||||
<WrapPanel Margin="16">
|
||||
<Image Margin="16" hc:Magnifier.Instance="{x:Static hc:Magnifier.Default}" Source="/HandyControlDemo;component/Resources/Img/b1.jpg" Stretch="None"/>
|
||||
|
||||
<Image Margin="16" Source="/HandyControlDemo;component/Resources/Img/b1.jpg" Stretch="None">
|
||||
<hc:Magnifier.Instance>
|
||||
<hc:Magnifier Scale="6" HorizontalOffset="-16" VerticalOffset="-16"/>
|
||||
</hc:Magnifier.Instance>
|
||||
</Image>
|
||||
</WrapPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class MagnifierDemoCtl
|
||||
{
|
||||
public MagnifierDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,23 @@
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32" Width="300" Button.Click="ButtonProgress_OnClick" VerticalAlignment="Center">
|
||||
<hc:ProgressButton IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
</StackPanel>
|
||||
<WrapPanel Margin="16" VerticalAlignment="Center">
|
||||
<StackPanel Margin="16" Button.Click="ButtonProgress_OnClick">
|
||||
<hc:ProgressButton IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="16" Button.Click="ButtonProgress_OnClick">
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoading}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -195,6 +195,16 @@
|
||||
</hc:StatusSwitchElement.CheckedElement>
|
||||
</ToggleButton>
|
||||
<ListBox Name="ListBoxControl" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ImageBlockDemoCtl}" Content="{x:Static langs:Lang.ImageBlock}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ImageStack_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.MagnifierDemoCtl}" Content="{x:Static langs:Lang.Magnifier}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Search_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.GravatarDemoCtl}" Content="{x:Static langs:Lang.Gravatar}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/User_16x.png"/>
|
||||
@@ -210,6 +220,11 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/GoToTop_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ButtonGroupDemoCtl}" Content="{x:Static langs:Lang.ButtonGroup}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ButtonGroup_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressButtonDemoCtl}" Content="{x:Static langs:Lang.ProgressButton}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ProgressButton_16x.png"/>
|
||||
@@ -220,7 +235,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Bubble_16xLG.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.NotifyIconDemoCtl}" Content="{x:Static langs:Lang.NotifyIcon}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.NotifyIconDemoCtl}" Content="{x:Static langs:Lang.NotifyIcon}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/NotificationHub_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
@@ -310,12 +325,17 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/TextBlock_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.CardDemoCtl}" Content="{x:Static langs:Lang.Card}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/VSO_Card_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"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.GridDemoCtl}" Content="{x:Static langs:Lang.Grid}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.GridDemoCtl}" Content="{x:Static langs:Lang.Grid}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/GridPane_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
@@ -405,7 +425,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/TabPage_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.SideMenuDemoCtl}" Content="{x:Static langs:Lang.SideMenu}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.SideMenuDemoCtl}" Content="{x:Static langs:Lang.SideMenu}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/MainMenuControl_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
|
||||
@@ -11,19 +11,8 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="Stretch" Orientation="Horizontal">
|
||||
<Button Margin="4,0,0,0" Width="28" Height="29" Style="{StaticResource ButtonCustom}">
|
||||
<hc:Interaction.Triggers>
|
||||
<hc:EventTrigger EventName="Click">
|
||||
<hc:InvokeCommandAction Command="{x:Static SystemCommands.ShowSystemMenuCommand}" />
|
||||
</hc:EventTrigger>
|
||||
<hc:EventTrigger EventName="MouseDoubleClick">
|
||||
<hc:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
|
||||
</hc:EventTrigger>
|
||||
</hc:Interaction.Triggers>
|
||||
<Path Height="16" Fill="White" Stretch="Uniform" Data="{StaticResource LogoGeometry}"/>
|
||||
</Button>
|
||||
<Menu Margin="10,0,0,0" Background="Transparent">
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.Repository}">
|
||||
<MenuItem Height="29" Header="{x:Static langs:Lang.Repository}">
|
||||
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/NaBian/HandyControl" Header="GitHub">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource GithubGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
@@ -35,7 +24,7 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.About}">
|
||||
<MenuItem Height="29" Header="{x:Static langs:Lang.About}">
|
||||
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ContributorsView}" Header="{x:Static langs:Lang.Contributors}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ContributorsGeometry}" Fill="#ef6c00"/>
|
||||
@@ -67,7 +56,7 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.Recommendation}">
|
||||
<MenuItem Height="29" Header="{x:Static langs:Lang.Recommendation}">
|
||||
<MenuItem Header="{x:Static langs:Lang.Project}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ProjectsView}" >
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ProjectGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
@@ -81,7 +70,7 @@
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
|
||||
<Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryTextBrush}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
|
||||
<Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-25" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -58,31 +58,31 @@
|
||||
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="Radio"/>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
<hc:RadioGroup Margin="0,32,0,0">
|
||||
<hc:ButtonGroup Margin="0,32,0,0">
|
||||
<RadioButton Content="Radio" IsChecked="True"/>
|
||||
<RadioButton Content="Radio"/>
|
||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||
<RadioButton Content="Radio"/>
|
||||
</hc:RadioGroup>
|
||||
<hc:RadioGroup Margin="0,16,0,0" Style="{StaticResource RadioGroupSolid}">
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,16,0,0" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton Content="Radio"/>
|
||||
<RadioButton Content="Radio"/>
|
||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||
<RadioButton Content="Radio" IsChecked="True"/>
|
||||
</hc:RadioGroup>
|
||||
</hc:ButtonGroup>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<hc:RadioGroup Margin="0,16,8,0" Orientation="Vertical">
|
||||
<hc:ButtonGroup Margin="0,16,8,0" Orientation="Vertical">
|
||||
<RadioButton Content="Radio" IsChecked="True"/>
|
||||
<RadioButton Content="Radio"/>
|
||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||
<RadioButton Content="Radio"/>
|
||||
</hc:RadioGroup>
|
||||
<hc:RadioGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource RadioGroupSolid}">
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton Content="Radio"/>
|
||||
<RadioButton Content="Radio"/>
|
||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||
<RadioButton Content="Radio" IsChecked="True"/>
|
||||
</hc:RadioGroup>
|
||||
</hc:ButtonGroup>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
@@ -156,19 +156,19 @@
|
||||
<ProgressBar Style="{StaticResource ProgressBarFlat}" Margin="0,8,0,10" Value="110" Maximum="200" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="859" Height="264" Canvas.Top="130">
|
||||
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="859" Height="262" Canvas.Top="130">
|
||||
<ScrollViewer>
|
||||
<StackPanel VerticalAlignment="Top">
|
||||
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
|
||||
<StackPanel VerticalAlignment="Top" Width="206">
|
||||
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
|
||||
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
|
||||
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
<Expander Header="Title" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
|
||||
<Expander Header="Title" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
@@ -314,7 +314,7 @@
|
||||
</hc:Badge>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="128" Canvas.Top="310" Width="162" Height="84">
|
||||
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="128" Canvas.Top="310" Width="160" Height="84">
|
||||
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<hc:Shield Subject="chat" Status="on gitter" Margin="0,0,0,0" Color="#4eb899" Command="hc:ControlCommands.OpenLink" CommandParameter="https://gitter.im/HandyControl/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"/>
|
||||
<hc:Shield Subject="qq" Status="714704041" Margin="0,4,0,0" Color="#d8624c" Command="hc:ControlCommands.OpenLink" CommandParameter="http://shang.qq.com/wpa/qunwpa?idkey=a571e5553c9d41e49c4f22f3a8b2865451497a795ff281fedf3285def247efc1"/>
|
||||
@@ -343,13 +343,13 @@
|
||||
</hc:Transfer.ItemTemplate>
|
||||
</hc:Transfer>
|
||||
</Border>
|
||||
<Border Visibility="Collapsed" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="611" Canvas.Top="976">
|
||||
<userControl:CoverFlowDemoCtl Width="563" Margin="-32" Background="Transparent"/>
|
||||
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="611" Canvas.Top="976">
|
||||
<userControl:CoverFlowDemoCtl Width="559" Margin="-32" Background="Transparent"/>
|
||||
</Border>
|
||||
<Border Visibility="Collapsed" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1391" Canvas.Top="648" Width="274">
|
||||
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1391" Canvas.Top="648" Width="274">
|
||||
<userControl:ColorPickerDemoCtl Margin="-32" Background="Transparent"/>
|
||||
</Border>
|
||||
<Border Visibility="Collapsed" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1113" Canvas.Top="608" Width="264" Height="126">
|
||||
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1113" Canvas.Top="608" Width="264" Height="126">
|
||||
<hc:TagPanel Orientation="Horizontal" MaxWidth="400" VerticalAlignment="Center">
|
||||
<hc:Tag ShowCloseButton="False" Content="TextText"/>
|
||||
<hc:Tag Content="Text"/>
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32" VerticalAlignment="Center">
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
|
||||
<StackPanel Margin="32" VerticalAlignment="Center" Width="240">
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
|
||||
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
|
||||
@@ -20,31 +20,31 @@
|
||||
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
<hc:RadioGroup Margin="0,32,0,0">
|
||||
<hc:ButtonGroup Margin="0,32,0,0">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
</hc:RadioGroup>
|
||||
<hc:RadioGroup Margin="0,16,0,0" Style="{StaticResource RadioGroupSolid}">
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,16,0,0" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
</hc:RadioGroup>
|
||||
</hc:ButtonGroup>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<hc:RadioGroup Margin="0,16,8,0" Orientation="Vertical">
|
||||
<hc:ButtonGroup Margin="0,16,8,0" Orientation="Vertical">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
</hc:RadioGroup>
|
||||
<hc:RadioGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource RadioGroupSolid}">
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
</hc:RadioGroup>
|
||||
</hc:ButtonGroup>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace HandyControlDemo.ViewModel.Basic
|
||||
{
|
||||
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<string>
|
||||
{
|
||||
public Action<string> CloseAction { get; set; }
|
||||
public Action CloseAction { get; set; }
|
||||
|
||||
private string _result;
|
||||
|
||||
@@ -37,6 +37,6 @@ namespace HandyControlDemo.ViewModel.Basic
|
||||
#endif
|
||||
}
|
||||
|
||||
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke(""))).Value;
|
||||
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke())).Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class CardDemoViewModel : DemoViewModelBase<CardModel>
|
||||
{
|
||||
public CardDemoViewModel(DataService dataService)
|
||||
{
|
||||
DataList = dataService.GetCardDataList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ using GalaSoft.MvvmLight.CommandWpf;
|
||||
#endif
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Tools.Extension;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.UserControl;
|
||||
using HandyControlDemo.UserControl.Basic;
|
||||
using HandyControlDemo.ViewModel.Basic;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
@@ -39,24 +39,38 @@ namespace HandyControlDemo.ViewModel
|
||||
}
|
||||
|
||||
#if netle40
|
||||
public RelayCommand ShowInteractiveDialogCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(ShowInteractiveDialog)).Value;
|
||||
public RelayCommand<bool> ShowInteractiveDialogCmd => new Lazy<RelayCommand<bool>>(() =>
|
||||
new RelayCommand<bool>(ShowInteractiveDialog)).Value;
|
||||
|
||||
private void ShowInteractiveDialog()
|
||||
private void ShowInteractiveDialog(bool withTimer)
|
||||
{
|
||||
Dialog.Show<InteractiveDialog>()
|
||||
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
|
||||
.GetResultAsync<string>().ContinueWith(str => DialogResult = str.Result);
|
||||
if (!withTimer)
|
||||
{
|
||||
Dialog.Show<InteractiveDialog>()
|
||||
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
|
||||
.GetResultAsync<string>().ContinueWith(str => DialogResult = str.Result);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dialog.Show<TextDialogWithTimer>(MessageToken.MainWindow).GetResultAsync<string>();
|
||||
}
|
||||
}
|
||||
#else
|
||||
public RelayCommand ShowInteractiveDialogCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(async () => await ShowInteractiveDialog())).Value;
|
||||
public RelayCommand<bool> ShowInteractiveDialogCmd => new Lazy<RelayCommand<bool>>(() =>
|
||||
new RelayCommand<bool>(async withTimer => await ShowInteractiveDialog(withTimer))).Value;
|
||||
|
||||
private async Task ShowInteractiveDialog()
|
||||
private async Task ShowInteractiveDialog(bool withTimer)
|
||||
{
|
||||
DialogResult = await Dialog.Show<InteractiveDialog>()
|
||||
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
|
||||
.GetResultAsync<string>();
|
||||
if (!withTimer)
|
||||
{
|
||||
DialogResult = await Dialog.Show<InteractiveDialog>()
|
||||
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
|
||||
.GetResultAsync<string>();
|
||||
}
|
||||
else
|
||||
{
|
||||
await Dialog.Show<TextDialogWithTimer>(MessageToken.MainWindow).GetResultAsync<string>();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public PaginationDemoViewModel(DataService dataService)
|
||||
{
|
||||
_totalDataList = dataService.GetDemoDataList(100);
|
||||
_totalDataList = dataService.GetDemoDataList(10);
|
||||
DataList = _totalDataList.Take(10).ToList();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace HandyControlDemo.ViewModel
|
||||
SimpleIoc.Default.Register<SideMenuDemoViewModel>();
|
||||
SimpleIoc.Default.Register<TabControlDemoViewModel>();
|
||||
SimpleIoc.Default.Register<NoUserViewModel>();
|
||||
SimpleIoc.Default.Register<CardDemoViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||
@@ -87,6 +88,8 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public NoUserViewModel NoUser => ServiceLocator.Current.GetInstance<NoUserViewModel>();
|
||||
|
||||
public CardDemoViewModel CardDemo => ServiceLocator.Current.GetInstance<CardDemoViewModel>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="{x:Static langs:Lang.Title}"
|
||||
ShowTitle="True"
|
||||
Style="{StaticResource WindowBlur}"
|
||||
Height="450"
|
||||
Width="800"
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
mc:Ignorable="d"
|
||||
ShowTitle="True"
|
||||
Background="{DynamicResource MainContentBackgroundBrush}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
mc:Ignorable="d"
|
||||
OtherButtonForeground="{DynamicResource ReverseTextBrush}"
|
||||
CloseButtonForeground="{DynamicResource ReverseTextBrush}"
|
||||
OtherButtonHoverBackground="{DynamicResource ReverseTextBrush}"
|
||||
NonClientAreaBackground="{DynamicResource ToolBarBackground}"
|
||||
NonClientAreaHeight="69"
|
||||
Background="{DynamicResource MainContentBackgroundBrush}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
ShowTitle="False"
|
||||
Title="{x:Static langs:Lang.Title}"
|
||||
Height="450"
|
||||
Width="800">
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
BindingOperations.ClearBinding(border, FrameworkElement.MinWidthProperty);
|
||||
BindingOperations.ClearBinding(border, FrameworkElement.MinHeightProperty);
|
||||
BindingOperations.ClearBinding(border, FrameworkElement.ActualWidthProperty);
|
||||
BindingOperations.ClearBinding(border, FrameworkElement.ActualHeightProperty);
|
||||
BindingOperations.ClearBinding(border, Border.CornerRadiusProperty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Shapes;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools.Converter;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class RectangleAttach
|
||||
{
|
||||
public static readonly DependencyProperty CircularProperty = DependencyProperty.RegisterAttached(
|
||||
"Circular", typeof(bool), typeof(RectangleAttach), new PropertyMetadata(ValueBoxes.FalseBox, OnCircularChanged));
|
||||
|
||||
private static void OnCircularChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is Rectangle rectangle)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
{
|
||||
var binding = new MultiBinding
|
||||
{
|
||||
Converter = new RectangleCircularConverter()
|
||||
};
|
||||
binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) { Source = rectangle });
|
||||
binding.Bindings.Add(new Binding(FrameworkElement.ActualHeightProperty.Name) { Source = rectangle });
|
||||
rectangle.SetBinding(Rectangle.RadiusXProperty, binding);
|
||||
rectangle.SetBinding(Rectangle.RadiusYProperty, binding);
|
||||
}
|
||||
else
|
||||
{
|
||||
BindingOperations.ClearBinding(rectangle, FrameworkElement.ActualWidthProperty);
|
||||
BindingOperations.ClearBinding(rectangle, FrameworkElement.ActualHeightProperty);
|
||||
BindingOperations.ClearBinding(rectangle, Rectangle.RadiusXProperty);
|
||||
BindingOperations.ClearBinding(rectangle, Rectangle.RadiusYProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetCircular(DependencyObject element, bool value)
|
||||
=> element.SetValue(CircularProperty, value);
|
||||
|
||||
public static bool GetCircular(DependencyObject element)
|
||||
=> (bool) element.GetValue(CircularProperty);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,15 @@ namespace HandyControl.Controls
|
||||
=> element.SetValue(HighlightBrushProperty, value);
|
||||
|
||||
public static Brush GetHighlightBrush(DependencyObject element)
|
||||
=> (Brush) element.GetValue(HighlightBrushProperty);
|
||||
=> (Brush) element.GetValue(HighlightBrushProperty);
|
||||
|
||||
public static readonly DependencyProperty TextProperty = DependencyProperty.RegisterAttached(
|
||||
"Text", typeof(string), typeof(VisualElement), new PropertyMetadata(default(string)));
|
||||
|
||||
public static void SetText(DependencyObject element, string value)
|
||||
=> element.SetValue(TextProperty, value);
|
||||
|
||||
public static string GetText(DependencyObject element)
|
||||
=> (string) element.GetValue(TextProperty);
|
||||
}
|
||||
}
|
||||
@@ -478,7 +478,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
private void UpdateStatus(Color color)
|
||||
{
|
||||
if (_isOnDragging) return;
|
||||
if (_isOnDragging || _sliderColor == null) return;
|
||||
|
||||
var r = color.R;
|
||||
var g = color.G;
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace HandyControl.Controls
|
||||
/// <param name="pos"></param>
|
||||
private void Remove(int pos)
|
||||
{
|
||||
var item = _itemShowList[pos];
|
||||
if (!_itemShowList.TryGetValue(pos, out var item)) return;
|
||||
_visualParent.Children.Remove(item);
|
||||
_itemShowList.Remove(pos);
|
||||
}
|
||||
@@ -308,10 +308,17 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (content is Uri uri)
|
||||
{
|
||||
return new CoverFlowItem(index, PageIndex, new Image
|
||||
try
|
||||
{
|
||||
Source = BitmapFrame.Create(uri)
|
||||
});
|
||||
return new CoverFlowItem(index, PageIndex, new Image
|
||||
{
|
||||
Source = BitmapFrame.Create(uri, BitmapCreateOptions.DelayCreation, BitmapCacheOption.OnDemand)
|
||||
});
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new CoverFlowItem(index, PageIndex, new ContentControl());
|
||||
}
|
||||
}
|
||||
|
||||
return new CoverFlowItem(index, PageIndex, new ContentControl
|
||||
|
||||
@@ -33,6 +33,22 @@ namespace HandyControl.Controls
|
||||
VisibilityProperty.OverrideMetadata(typeof(GifImage), new PropertyMetadata(default(Visibility), OnVisibilityChanged));
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty UriProperty = DependencyProperty.Register(
|
||||
"Uri", typeof(Uri), typeof(GifImage), new PropertyMetadata(default(Uri), OnUriChanged));
|
||||
|
||||
private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (GifImage) d;
|
||||
var v = (Uri)e.NewValue;
|
||||
ctl.Source = new BitmapImage(v);
|
||||
}
|
||||
|
||||
public Uri Uri
|
||||
{
|
||||
get => (Uri) GetValue(UriProperty);
|
||||
set => SetValue(UriProperty, value);
|
||||
}
|
||||
|
||||
private static void OnVisibilityChanged(DependencyObject s, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (GifImage)s;
|
||||
@@ -56,10 +72,14 @@ namespace HandyControl.Controls
|
||||
if (DesignerProperties.GetIsInDesignMode(this)) return;
|
||||
if (_isLoaded) return;
|
||||
_isLoaded = true;
|
||||
if (Source is BitmapImage image)
|
||||
if (Uri != null)
|
||||
{
|
||||
var uri = image.UriSource;
|
||||
GetGifStreamFromPack(uri);
|
||||
GetGifStreamFromPack(Uri);
|
||||
StartAnimate();
|
||||
}
|
||||
else if (Source is BitmapImage image)
|
||||
{
|
||||
GetGifStreamFromPack(image.UriSource);
|
||||
StartAnimate();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class ImageBlock : FrameworkElement
|
||||
{
|
||||
private readonly DispatcherTimer _dispatcherTimer;
|
||||
|
||||
private BitmapSource _source;
|
||||
|
||||
private int _indexMax;
|
||||
|
||||
private int _indexMin;
|
||||
|
||||
private int _currentIndex;
|
||||
|
||||
private int _blockWidth;
|
||||
|
||||
private int _blockHeight;
|
||||
|
||||
public ImageBlock()
|
||||
{
|
||||
_dispatcherTimer = new DispatcherTimer
|
||||
{
|
||||
Interval = Interval
|
||||
};
|
||||
_dispatcherTimer.Tick += DispatcherTimer_Tick;
|
||||
}
|
||||
|
||||
private void UpdateDatas()
|
||||
{
|
||||
if (_source == null) return;
|
||||
_indexMin = StartRow * Columns + StartColumn;
|
||||
_indexMax = EndRow * Columns + EndColumn;
|
||||
_currentIndex = _indexMin;
|
||||
_blockWidth = _source.PixelWidth / Columns;
|
||||
_blockHeight = _source.PixelHeight / Rows;
|
||||
}
|
||||
|
||||
private static void OnPositionsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock)d;
|
||||
ctl.UpdateDatas();
|
||||
}
|
||||
|
||||
private void DispatcherTimer_Tick(object sender, EventArgs e) => InvalidateVisual();
|
||||
|
||||
public static readonly DependencyProperty StartColumnProperty = DependencyProperty.Register(
|
||||
"StartColumn", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
|
||||
|
||||
public int StartColumn
|
||||
{
|
||||
get => (int) GetValue(StartColumnProperty);
|
||||
set => SetValue(StartColumnProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty StartRowProperty = DependencyProperty.Register(
|
||||
"StartRow", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
|
||||
|
||||
public int StartRow
|
||||
{
|
||||
get => (int) GetValue(StartRowProperty);
|
||||
set => SetValue(StartRowProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty EndColumnProperty = DependencyProperty.Register(
|
||||
"EndColumn", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
|
||||
|
||||
public int EndColumn
|
||||
{
|
||||
get => (int) GetValue(EndColumnProperty);
|
||||
set => SetValue(EndColumnProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty EndRowProperty = DependencyProperty.Register(
|
||||
"EndRow", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
|
||||
|
||||
public int EndRow
|
||||
{
|
||||
get => (int) GetValue(EndRowProperty);
|
||||
set => SetValue(EndRowProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register(
|
||||
"IsPlaying", typeof(bool), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnIsPlayingChanged));
|
||||
|
||||
private static void OnIsPlayingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock)d;
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
ctl._dispatcherTimer.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
ctl._dispatcherTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlaying
|
||||
{
|
||||
get => (bool) GetValue(IsPlayingProperty);
|
||||
set => SetValue(IsPlayingProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register(
|
||||
"Columns", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int)obj >= 1);
|
||||
|
||||
public int Columns
|
||||
{
|
||||
get => (int) GetValue(ColumnsProperty);
|
||||
set => SetValue(ColumnsProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty RowsProperty = DependencyProperty.Register(
|
||||
"Rows", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int)obj >= 1);
|
||||
|
||||
public int Rows
|
||||
{
|
||||
get => (int) GetValue(RowsProperty);
|
||||
set => SetValue(RowsProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register(
|
||||
"Interval", typeof(TimeSpan), typeof(ImageBlock), new PropertyMetadata(TimeSpan.FromSeconds(1), OnIntervalChanged));
|
||||
|
||||
private static void OnIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock) d;
|
||||
ctl._dispatcherTimer.Interval = (TimeSpan) e.NewValue;
|
||||
}
|
||||
|
||||
public TimeSpan Interval
|
||||
{
|
||||
get => (TimeSpan) GetValue(IntervalProperty);
|
||||
set => SetValue(IntervalProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
|
||||
"Source", typeof(ImageSource), typeof(ImageBlock), new FrameworkPropertyMetadata(default(ImageSource),
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnSourceChanged));
|
||||
|
||||
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock)d;
|
||||
ctl._source = e.NewValue as BitmapSource;
|
||||
ctl.UpdateDatas();
|
||||
}
|
||||
|
||||
public ImageSource Source
|
||||
{
|
||||
get => (ImageSource)GetValue(SourceProperty);
|
||||
set => SetValue(SourceProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnRender(DrawingContext dc)
|
||||
{
|
||||
if (_source == null) return;
|
||||
var croppedBitmap = new CroppedBitmap(_source, CalDisplayRect());
|
||||
dc.DrawImage(croppedBitmap, new Rect(0, 0, RenderSize.Width, RenderSize.Height));
|
||||
}
|
||||
|
||||
private Int32Rect CalDisplayRect()
|
||||
{
|
||||
if (_currentIndex > _indexMax)
|
||||
{
|
||||
_currentIndex = _indexMin;
|
||||
}
|
||||
|
||||
var x = _currentIndex % Columns * _blockWidth;
|
||||
var y = _currentIndex / Columns * _blockHeight;
|
||||
|
||||
var rect = new Int32Rect(x, y, _blockWidth, _blockHeight);
|
||||
_currentIndex++;
|
||||
return rect;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class RadioGroup : ItemsControl
|
||||
public class ButtonGroup : ItemsControl
|
||||
{
|
||||
protected override DependencyObject GetContainerForItemOverride() => new RadioButton();
|
||||
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is RadioButton;
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is Button || item is RadioButton || item is ToggleButton;
|
||||
|
||||
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
|
||||
"Orientation", typeof(Orientation), typeof(RadioGroup), new PropertyMetadata(default(Orientation)));
|
||||
"Orientation", typeof(Orientation), typeof(ButtonGroup), new PropertyMetadata(default(Orientation)));
|
||||
|
||||
public Orientation Orientation
|
||||
{
|
||||
@@ -20,7 +19,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ItemStyleSelectorProperty = DependencyProperty.Register(
|
||||
"ItemStyleSelector", typeof(StyleSelector), typeof(RadioGroup), new PropertyMetadata(new RadioGroupItemStyleSelector()));
|
||||
"ItemStyleSelector", typeof(StyleSelector), typeof(ButtonGroup), new PropertyMetadata(new ButtonGroupItemStyleSelector()));
|
||||
|
||||
public StyleSelector ItemStyleSelector
|
||||
{
|
||||
@@ -35,9 +34,9 @@ namespace HandyControl.Controls
|
||||
var count = Items.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var item = (RadioButton)Items[i];
|
||||
var item = (ButtonBase)Items[i];
|
||||
item.Style = ItemStyleSelector?.SelectStyle(item, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class Card : ContentControl
|
||||
{
|
||||
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
|
||||
"Header", typeof(object), typeof(Card), new PropertyMetadata(default(object)));
|
||||
|
||||
public object Header
|
||||
{
|
||||
get => GetValue(HeaderProperty);
|
||||
set => SetValue(HeaderProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register(
|
||||
"HeaderTemplate", typeof(DataTemplate), typeof(Card), new PropertyMetadata(default(DataTemplate)));
|
||||
|
||||
[Bindable(true), Category("Content")]
|
||||
public DataTemplate HeaderTemplate
|
||||
{
|
||||
get => (DataTemplate) GetValue(HeaderTemplateProperty);
|
||||
set => SetValue(HeaderTemplateProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty HeaderTemplateSelectorProperty = DependencyProperty.Register(
|
||||
"HeaderTemplateSelector", typeof(DataTemplateSelector), typeof(Card), new PropertyMetadata(default(DataTemplateSelector)));
|
||||
|
||||
[Bindable(true), Category("Content")]
|
||||
public DataTemplateSelector HeaderTemplateSelector
|
||||
{
|
||||
get => (DataTemplateSelector) GetValue(HeaderTemplateSelectorProperty);
|
||||
set => SetValue(HeaderTemplateSelectorProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty HeaderStringFormatProperty = DependencyProperty.Register(
|
||||
"HeaderStringFormat", typeof(string), typeof(Card), new PropertyMetadata(default(string)));
|
||||
|
||||
[Bindable(true), Category("Content")]
|
||||
public string HeaderStringFormat
|
||||
{
|
||||
get => (string) GetValue(HeaderStringFormatProperty);
|
||||
set => SetValue(HeaderStringFormatProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FooterProperty = DependencyProperty.Register(
|
||||
"Footer", typeof(object), typeof(Card), new PropertyMetadata(default(object)));
|
||||
|
||||
public object Footer
|
||||
{
|
||||
get => GetValue(FooterProperty);
|
||||
set => SetValue(FooterProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FooterTemplateProperty = DependencyProperty.Register(
|
||||
"FooterTemplate", typeof(DataTemplate), typeof(Card), new PropertyMetadata(default(DataTemplate)));
|
||||
|
||||
[Bindable(true), Category("Content")]
|
||||
public DataTemplate FooterTemplate
|
||||
{
|
||||
get => (DataTemplate) GetValue(FooterTemplateProperty);
|
||||
set => SetValue(FooterTemplateProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FooterTemplateSelectorProperty = DependencyProperty.Register(
|
||||
"FooterTemplateSelector", typeof(DataTemplateSelector), typeof(Card), new PropertyMetadata(default(DataTemplateSelector)));
|
||||
|
||||
[Bindable(true), Category("Content")]
|
||||
public DataTemplateSelector FooterTemplateSelector
|
||||
{
|
||||
get => (DataTemplateSelector) GetValue(FooterTemplateSelectorProperty);
|
||||
set => SetValue(FooterTemplateSelectorProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FooterStringFormatProperty = DependencyProperty.Register(
|
||||
"FooterStringFormat", typeof(string), typeof(Card), new PropertyMetadata(default(string)));
|
||||
|
||||
[Bindable(true), Category("Content")]
|
||||
public string FooterStringFormat
|
||||
{
|
||||
get => (string) GetValue(FooterStringFormatProperty);
|
||||
set => SetValue(FooterStringFormatProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace HandyControl.Controls
|
||||
_itemsControl = GetTemplateChild(ElementItemsControl) as ItemsPresenter;
|
||||
_panelPage = GetTemplateChild(ElementPanelPage) as Panel;
|
||||
|
||||
CheckNull();
|
||||
if (!CheckNull()) return;
|
||||
|
||||
_panelPage.AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(ButtonPages_OnClick));
|
||||
_appliedTemplate = true;
|
||||
@@ -74,10 +74,7 @@ namespace HandyControl.Controls
|
||||
UpdatePageButtons(_pageIndex);
|
||||
}
|
||||
|
||||
private void CheckNull()
|
||||
{
|
||||
if (_itemsControl == null || _panelPage == null) throw new Exception();
|
||||
}
|
||||
private bool CheckNull() => !(_itemsControl == null || _panelPage == null);
|
||||
|
||||
public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register(
|
||||
"AutoRun", typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
|
||||
@@ -195,6 +192,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
public void UpdatePageButtons(int index = -1)
|
||||
{
|
||||
if (!CheckNull()) return;
|
||||
if (!_appliedTemplate) return;
|
||||
|
||||
var count = Items.Count;
|
||||
@@ -236,6 +234,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
private void UpdateItemsPosition()
|
||||
{
|
||||
if (!CheckNull()) return;
|
||||
if (!_appliedTemplate) return;
|
||||
if (Items.Count == 0) return;
|
||||
if (!IsCenter)
|
||||
@@ -284,6 +283,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void ButtonPages_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!CheckNull()) return;
|
||||
if (_selectedButton != null && _selectedButton.Content is Border borderOri)
|
||||
borderOri.Background = Brushes.White;
|
||||
_selectedButton = e.OriginalSource as Button;
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public class Dialog : ContentControl
|
||||
{
|
||||
private string _token;
|
||||
|
||||
private Adorner _container;
|
||||
|
||||
private static readonly Dictionary<string, System.Windows.Window> WindowDic = new Dictionary<string, System.Windows.Window>();
|
||||
@@ -99,6 +101,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var dialog = new Dialog
|
||||
{
|
||||
_token = token,
|
||||
Content = content
|
||||
};
|
||||
|
||||
@@ -139,19 +142,16 @@ namespace HandyControl.Controls
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public void Close(string token = "")
|
||||
public void Close()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
if (WindowDic.TryGetValue(token, out var window))
|
||||
{
|
||||
Close(window);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (string.IsNullOrEmpty(_token))
|
||||
{
|
||||
Close(VisualHelper.GetActiveWindow());
|
||||
}
|
||||
else if (WindowDic.TryGetValue(_token, out var window))
|
||||
{
|
||||
Close(window);
|
||||
}
|
||||
}
|
||||
|
||||
private void Close(System.Windows.Window window)
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Interactivity;
|
||||
using HandyControl.Tools;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
[TemplatePart(Name = ElementVisualBrush, Type = typeof(VisualBrush))]
|
||||
public class Magnifier : Control
|
||||
{
|
||||
private Size _viewboxSize;
|
||||
|
||||
private AdornerContainer _adorner;
|
||||
|
||||
private UIElement _elementTarget;
|
||||
|
||||
private const string ElementVisualBrush = "PART_VisualBrush";
|
||||
|
||||
private VisualBrush _visualBrush = new VisualBrush();
|
||||
|
||||
private readonly TranslateTransform _translateTransform;
|
||||
|
||||
public static readonly DependencyProperty HorizontalOffsetProperty = DependencyProperty.Register(
|
||||
"HorizontalOffset", typeof(double), typeof(Magnifier), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||
|
||||
public double HorizontalOffset
|
||||
{
|
||||
get => (double) GetValue(HorizontalOffsetProperty);
|
||||
set => SetValue(HorizontalOffsetProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty VerticalOffsetProperty = DependencyProperty.Register(
|
||||
"VerticalOffset", typeof(double), typeof(Magnifier), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||
|
||||
public double VerticalOffset
|
||||
{
|
||||
get => (double) GetValue(VerticalOffsetProperty);
|
||||
set => SetValue(VerticalOffsetProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty InstanceProperty = DependencyProperty.RegisterAttached(
|
||||
"Instance", typeof(Magnifier), typeof(Magnifier), new PropertyMetadata(default(Magnifier), OnMagnifierChanged));
|
||||
|
||||
private static void OnMagnifierChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is UIElement target)) return;
|
||||
var magnifier = (Magnifier)e.NewValue;
|
||||
magnifier.Target = target;
|
||||
}
|
||||
|
||||
public static void SetInstance(DependencyObject element, Magnifier value)
|
||||
=> element.SetValue(InstanceProperty, value);
|
||||
|
||||
public static Magnifier GetInstance(DependencyObject element)
|
||||
=> (Magnifier) element.GetValue(InstanceProperty);
|
||||
|
||||
public static Magnifier Default => new Magnifier();
|
||||
|
||||
internal static readonly DependencyProperty TargetProperty = DependencyProperty.Register(
|
||||
"Target", typeof(UIElement), typeof(Magnifier), new PropertyMetadata(default(UIElement), OnTargetChanged));
|
||||
|
||||
private static void OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (Magnifier) d;
|
||||
ctl.UpdateTarget(ctl._elementTarget, false);
|
||||
ctl.UpdateTarget((UIElement)e.NewValue, true);
|
||||
}
|
||||
|
||||
internal UIElement Target
|
||||
{
|
||||
get => (UIElement)GetValue(TargetProperty);
|
||||
set => SetValue(TargetProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ScaleProperty = DependencyProperty.Register(
|
||||
"Scale", typeof(double), typeof(Magnifier), new PropertyMetadata(5.0, OnScaleChanged), ValidateHelper.IsInRangeOfPosDouble);
|
||||
|
||||
private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Magnifier)d).UpdateViewboxSize();
|
||||
|
||||
public double Scale
|
||||
{
|
||||
get => (double)GetValue(ScaleProperty);
|
||||
set => SetValue(ScaleProperty, value);
|
||||
}
|
||||
|
||||
public Magnifier()
|
||||
{
|
||||
_translateTransform = new TranslateTransform();
|
||||
RenderTransform = _translateTransform;
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
var visualBrush = GetTemplateChild(ElementVisualBrush) as VisualBrush ?? new VisualBrush();
|
||||
visualBrush.Viewbox = _visualBrush.Viewbox;
|
||||
_visualBrush = visualBrush;
|
||||
}
|
||||
|
||||
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
|
||||
{
|
||||
base.OnRenderSizeChanged(sizeInfo);
|
||||
UpdateViewboxSize();
|
||||
}
|
||||
|
||||
private void UpdateViewboxSize() => _viewboxSize = new Size(ActualWidth / Scale, ActualHeight / Scale);
|
||||
|
||||
private void UpdateTarget(UIElement element , bool isNew)
|
||||
{
|
||||
if (element == null) return;
|
||||
|
||||
if (!isNew)
|
||||
{
|
||||
element.MouseEnter -= Element_MouseEnter;
|
||||
element.MouseLeave -= Element_MouseLeave;
|
||||
element.MouseMove -= Element_MouseMove;
|
||||
_elementTarget = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
element.MouseEnter += Element_MouseEnter;
|
||||
element.MouseLeave += Element_MouseLeave;
|
||||
element.MouseMove += Element_MouseMove;
|
||||
_elementTarget = element;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateLocation()
|
||||
{
|
||||
var targetPoint = Mouse.GetPosition(Target);
|
||||
var subX = targetPoint.X - _visualBrush.Viewbox.Width / 2;
|
||||
var subY = targetPoint.Y - _visualBrush.Viewbox.Height / 2;
|
||||
|
||||
var targetVector = VisualTreeHelper.GetOffset(Target);
|
||||
_visualBrush.Viewbox = new Rect(new Point(subX + targetVector.X, subY + targetVector.Y), _viewboxSize);
|
||||
|
||||
var adornerPoint = Mouse.GetPosition(_adorner);
|
||||
_translateTransform.X = adornerPoint.X + HorizontalOffset;
|
||||
_translateTransform.Y = adornerPoint.Y + VerticalOffset;
|
||||
}
|
||||
|
||||
private void Element_MouseMove(object sender, MouseEventArgs e) => UpdateLocation();
|
||||
|
||||
private void Element_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
var layer = AdornerLayer.GetAdornerLayer(Target);
|
||||
if (layer == null) return;
|
||||
layer.Remove(_adorner);
|
||||
_adorner.Child = null;
|
||||
_adorner = null;
|
||||
}
|
||||
|
||||
private void Element_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (_adorner == null)
|
||||
{
|
||||
var layer = AdornerLayer.GetAdornerLayer(Target);
|
||||
if (layer == null) return;
|
||||
_adorner = new AdornerContainer(layer)
|
||||
{
|
||||
Child = this
|
||||
};
|
||||
layer.Add(_adorner);
|
||||
}
|
||||
this.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,7 @@ namespace HandyControl.Controls
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Prev, ButtonPrev_OnClick));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Next, ButtonNext_OnClick));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Selected, ToggleButton_OnChecked));
|
||||
this.Show(MaxPageCount > 1);
|
||||
}
|
||||
|
||||
#region Public Properties
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// 切换块
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 在不需要命中测试的情况下可代替ToggleButton或CheckBox,以减少内存用量。
|
||||
/// </remarks>
|
||||
public class ToggleBlock : Control
|
||||
{
|
||||
public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register(
|
||||
"IsChecked", typeof(bool?), typeof(ToggleBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox,
|
||||
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal));
|
||||
|
||||
[Category("Appearance")]
|
||||
[TypeConverter(typeof(NullableBoolConverter))]
|
||||
[Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)]
|
||||
public bool? IsChecked
|
||||
{
|
||||
get
|
||||
{
|
||||
// Because Nullable<bool> unboxing is very slow (uses reflection) first we cast to bool
|
||||
var value = GetValue(IsCheckedProperty);
|
||||
// ReSharper disable once RedundantExplicitNullableCreation
|
||||
return value == null ? new bool?() : new bool?((bool)value);
|
||||
}
|
||||
set => SetValue(IsCheckedProperty, value.HasValue ? ValueBoxes.BooleanBox(value.Value) : null);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty CheckedContentProperty = DependencyProperty.Register(
|
||||
"CheckedContent", typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object)));
|
||||
|
||||
public object CheckedContent
|
||||
{
|
||||
get => GetValue(CheckedContentProperty);
|
||||
set => SetValue(CheckedContentProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty UnCheckedContentProperty = DependencyProperty.Register(
|
||||
"UnCheckedContent", typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object)));
|
||||
|
||||
public object UnCheckedContent
|
||||
{
|
||||
get => GetValue(UnCheckedContentProperty);
|
||||
set => SetValue(UnCheckedContentProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IndeterminateContentProperty = DependencyProperty.Register(
|
||||
"IndeterminateContent", typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object)));
|
||||
|
||||
public object IndeterminateContent
|
||||
{
|
||||
get => GetValue(IndeterminateContentProperty);
|
||||
set => SetValue(IndeterminateContentProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ namespace HandyControl.Controls
|
||||
[TemplatePart(Name = OverflowScrollviewer, Type = typeof(ScrollViewer))]
|
||||
[TemplatePart(Name = ScrollButtonLeft, Type = typeof(Button))]
|
||||
[TemplatePart(Name = ScrollButtonRight, Type = typeof(Button))]
|
||||
[TemplatePart(Name = HeaderBorder, Type = typeof(Border))]
|
||||
public class TabControl : System.Windows.Controls.TabControl
|
||||
{
|
||||
private const string OverflowButtonKey = "PART_OverflowButton";
|
||||
@@ -27,6 +28,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private const string ScrollButtonRight = "PART_ScrollButtonRight";
|
||||
|
||||
private const string HeaderBorder = "PART_HeaderBorder";
|
||||
|
||||
private ContextMenuToggleButton _buttonOverflow;
|
||||
|
||||
private TabPanel _headerPanel;
|
||||
@@ -37,6 +40,8 @@ namespace HandyControl.Controls
|
||||
|
||||
private Button _buttonScrollRight;
|
||||
|
||||
private Border _headerBorder;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为内部操作
|
||||
/// </summary>
|
||||
@@ -220,6 +225,9 @@ namespace HandyControl.Controls
|
||||
item.TabPanel = _headerPanel;
|
||||
}
|
||||
}
|
||||
|
||||
_headerBorder?.InvalidateMeasure();
|
||||
|
||||
IsInternalAction = false;
|
||||
}
|
||||
|
||||
@@ -248,6 +256,7 @@ namespace HandyControl.Controls
|
||||
_scrollViewerOverflow = GetTemplateChild(OverflowScrollviewer) as ScrollViewer;
|
||||
_buttonScrollLeft = GetTemplateChild(ScrollButtonLeft) as Button;
|
||||
_buttonScrollRight = GetTemplateChild(ScrollButtonRight) as Button;
|
||||
_headerBorder = GetTemplateChild(HeaderBorder) as Border;
|
||||
|
||||
if (_buttonScrollLeft != null) _buttonScrollLeft.Click += ButtonScrollLeft_Click;
|
||||
if (_buttonScrollRight != null) _buttonScrollRight.Click += ButtonScrollRight_Click;
|
||||
|
||||