Merge pull request #427 from HandyOrg/add-CheckComboBox
Add check combo box
This commit is contained in:
38 files changed
+1073
-14
No files matched your search
+6
-2
@@ -119,6 +119,10 @@ Step 4: Enjoy coding
|
||||
|
||||
## Latest examples
|
||||
|
||||
### CheckComboBox
|
||||
|
||||

|
||||
|
||||
### ImageSelector
|
||||
|
||||

|
||||
@@ -135,12 +139,12 @@ Step 4: Enjoy coding
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### GlowWindow
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### FlowDocumentScrollViewerStyle
|
||||
|
||||

|
||||
|
||||
@@ -119,6 +119,10 @@ Step 4: Enjoy coding
|
||||
|
||||
## Latest examples
|
||||
|
||||
### CheckComboBox
|
||||
|
||||

|
||||
|
||||
### ImageSelector
|
||||
|
||||

|
||||
@@ -135,12 +139,12 @@ Step 4: Enjoy coding
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### GlowWindow
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### FlowDocumentScrollViewerStyle
|
||||
|
||||

|
||||
|
||||
@@ -223,6 +223,9 @@
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\CheckBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\CheckBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\CheckBoxList_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\CheckBoxList_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ColorPalette_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ColorPalette_16x.png</Link>
|
||||
</Resource>
|
||||
|
||||
@@ -223,6 +223,9 @@
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\CheckBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\CheckBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\CheckBoxList_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\CheckBoxList_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ColorPalette_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ColorPalette_16x.png</Link>
|
||||
</Resource>
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
[ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "" ],
|
||||
[ "Border", "BorderDemoCtl", "BorderElement_16x", "" ],
|
||||
[ "Label", "LabelDemoCtl", "Label_16x", "" ],
|
||||
[ "Frame", "FrameDemoCtl", "frame_16xLG", "1" ],
|
||||
[ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "1" ],
|
||||
[ "Frame", "FrameDemoCtl", "frame_16xLG", "" ],
|
||||
[ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "" ],
|
||||
[ "Geometry", "GeometryDemoCtl", "Path_16x", "1" ]
|
||||
]
|
||||
},
|
||||
@@ -57,6 +57,7 @@
|
||||
[ "NumericUpDown", "NumericUpDownDemoCtl", "NumericListBox_16x", "" ],
|
||||
[ "TextBox", "TextBoxDemoCtl", "TextBox_16x", "" ],
|
||||
[ "ComboBox", "ComboBoxDemoCtl", "ComboBox_16x", "" ],
|
||||
[ "CheckComboBox", "CheckComboBoxDemoCtl", "CheckBoxList_16x", "1" ],
|
||||
[ "PasswordBox", "PasswordBoxDemoCtl", "PasswordBox_16x", "" ],
|
||||
[ "PinBox", "PinBoxDemoCtl", "Ellipsis_16x", "" ],
|
||||
[ "DatePicker", "DatePickerDemoCtl", "DatePicker_16x", "" ],
|
||||
@@ -104,7 +105,7 @@
|
||||
[ "Notification", "NotificationDemoCtl", "Procedure_16x", "" ],
|
||||
[ "Dialog", "DialogDemoCtl", "Dialog_16x", "" ],
|
||||
[ "Screenshot", "ScreenshotDemoCtl", "WindowScreenshot_16x", "1" ],
|
||||
[ "Window", "WindowDemoCtl", "WindowsForm_16x", "1" ]
|
||||
[ "Window", "WindowDemoCtl", "WindowsForm_16x", "" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -113,6 +113,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ChatBubbleDemoCtl.xaml.cs">
|
||||
<DependentUpon>ChatBubbleDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CheckComboBoxDemoCtl.xaml.cs">
|
||||
<DependentUpon>CheckComboBoxDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CirclePanelDemoCtl.xaml.cs">
|
||||
<DependentUpon>CirclePanelDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -598,6 +601,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CheckComboBoxDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CirclePanelDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -266,7 +266,18 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
return ResourceManager.GetString("CheckBox", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 多选组合框 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string CheckComboBox
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("CheckComboBox", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 圆形布局 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>Geometry</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>CheckComboBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>Geometry</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>CheckComboBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>Geometry</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>CheckComboBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>Geometry</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>CheckComboBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>Geometry</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>CheckComboBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>几何形状</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>多选组合框</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>Geometry</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>CheckComboBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -759,4 +759,7 @@
|
||||
<data name="Geometry" xml:space="preserve">
|
||||
<value>Geometry</value>
|
||||
</data>
|
||||
<data name="CheckComboBox" xml:space="preserve">
|
||||
<value>CheckComboBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -60,7 +60,8 @@ namespace HandyControlDemo.Properties.Langs
|
||||
OnPropertyChanged(nameof(ChatBubble));
|
||||
OnPropertyChanged(nameof(Chatroom));
|
||||
OnPropertyChanged(nameof(CheckBox));
|
||||
OnPropertyChanged(nameof(CirclePanel));
|
||||
OnPropertyChanged(nameof(CheckComboBox));
|
||||
OnPropertyChanged(nameof(CirclePanel));
|
||||
OnPropertyChanged(nameof(Clear));
|
||||
OnPropertyChanged(nameof(Click2Count));
|
||||
OnPropertyChanged(nameof(Clock));
|
||||
@@ -368,6 +369,11 @@ namespace HandyControlDemo.Properties.Langs
|
||||
/// </summary>
|
||||
public string CheckBox => Lang.CheckBox;
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 多选组合框 的本地化字符串。
|
||||
/// </summary>
|
||||
public string CheckComboBox => Lang.CheckComboBox;
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 圆形布局 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -1447,6 +1453,11 @@ namespace HandyControlDemo.Properties.Langs
|
||||
/// </summary>
|
||||
public static string CheckBox = nameof(CheckBox);
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 多选组合框 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string CheckComboBox = nameof(CheckComboBox);
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 圆形布局 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 134 B |
@@ -0,0 +1,33 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.CheckComboBoxDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
DataContext="{Binding ComboBoxDemo,Source={StaticResource Locator}}"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32" Orientation="Horizontal">
|
||||
<StackPanel>
|
||||
<hc:CheckComboBox ShowClearButton="True" MaxWidth="380" ItemsSource="{Binding DataList}" ShowSelectAllButton="True"/>
|
||||
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxExtend}" Margin="0,16,0,0" IsEnabled="False" ShowSelectAllButton="True"/>
|
||||
|
||||
<hc:CheckComboBox ShowClearButton="True" MaxWidth="380" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
|
||||
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
|
||||
<hc:CheckComboBox ShowClearButton="True" Width="380" ItemsSource="{Binding DataList}" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
|
||||
<hc:CheckComboBox Width="380" ItemsSource="{Binding DataList}" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="32,0,0,0">
|
||||
<hc:CheckComboBox ShowClearButton="True" MaxWidth="380" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxPlus}" ShowSelectAllButton="True"/>
|
||||
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" Margin="0,16,0,0" IsEnabled="False" Style="{StaticResource CheckComboBoxPlus}"/>
|
||||
|
||||
<hc:CheckComboBox MaxWidth="380" ShowClearButton="True" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
|
||||
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
|
||||
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" ShowClearButton="True" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
|
||||
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CheckComboBoxDemoCtl
|
||||
{
|
||||
public CheckComboBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,7 @@
|
||||
<Button Click="ButtonCustomContent_OnClick" Content="{ex:Lang Key={x:Static langs:LangKeys.OpenCustomContentWindow}}"/>
|
||||
<Button Name="ButtonMouseFollow" Click="ButtonMouseFollow_OnClick" Content="{ex:Lang Key={x:Static langs:LangKeys.OpenMouseFollowWindow}}"/>
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.NoNonClientAreaDragableWindow}" Content="{ex:Lang Key={x:Static langs:LangKeys.OpenNoNonClientAreaDragableWindow}}"/>
|
||||
<hc:Badge Text="New" Style="{StaticResource BadgeDanger}" VerticalAlignment="Center" HorizontalAlignment="Center" BadgeMargin="0,-10,-20,0">
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.GlowWindow}" Content="{ex:Lang Key={x:Static langs:LangKeys.OpenGlowWindow}}"/>
|
||||
</hc:Badge>
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.GlowWindow}" Content="{ex:Lang Key={x:Static langs:LangKeys.OpenGlowWindow}}"/>
|
||||
</UniformGrid>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,225 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Interactivity;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
[TemplatePart(Name = ElementPanel, Type = typeof(Panel))]
|
||||
[TemplatePart(Name = ElementSelectAll, Type = typeof(CheckComboBoxItem))]
|
||||
public class CheckComboBox : ListBox, IDataInput
|
||||
{
|
||||
private const string ElementPanel = "PART_Panel";
|
||||
|
||||
private const string ElementSelectAll = "PART_SelectAll";
|
||||
|
||||
private Panel _panel;
|
||||
|
||||
private CheckComboBoxItem _selectAllItem;
|
||||
|
||||
private bool _isInternalAction;
|
||||
|
||||
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
|
||||
"IsError", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool IsError
|
||||
{
|
||||
get => (bool) GetValue(IsErrorProperty);
|
||||
set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
|
||||
"ErrorStr", typeof(string), typeof(CheckComboBox), new PropertyMetadata(default(string)));
|
||||
|
||||
public string ErrorStr
|
||||
{
|
||||
get => (string) GetValue(ErrorStrProperty);
|
||||
set => SetValue(ErrorStrProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register(
|
||||
"TextType", typeof(TextType), typeof(CheckComboBox), new PropertyMetadata(default(TextType)));
|
||||
|
||||
public TextType TextType
|
||||
{
|
||||
get => (TextType) GetValue(TextTypeProperty);
|
||||
set => SetValue(TextTypeProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
|
||||
"ShowClearButton", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool ShowClearButton
|
||||
{
|
||||
get => (bool) GetValue(ShowClearButtonProperty);
|
||||
set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty MaxDropDownHeightProperty =
|
||||
System.Windows.Controls.ComboBox.MaxDropDownHeightProperty.AddOwner(typeof(CheckComboBox),
|
||||
new FrameworkPropertyMetadata(SystemParameters.PrimaryScreenHeight / 3));
|
||||
|
||||
[Bindable(true), Category("Layout")]
|
||||
[TypeConverter(typeof(LengthConverter))]
|
||||
public double MaxDropDownHeight
|
||||
{
|
||||
get => (double) GetValue(MaxDropDownHeightProperty);
|
||||
set => SetValue(MaxDropDownHeightProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register(
|
||||
"IsDropDownOpen", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool IsDropDownOpen
|
||||
{
|
||||
get => (bool) GetValue(IsDropDownOpenProperty);
|
||||
set => SetValue(IsDropDownOpenProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TagStyleProperty = DependencyProperty.Register(
|
||||
"TagStyle", typeof(Style), typeof(CheckComboBox), new PropertyMetadata(default(Style)));
|
||||
|
||||
public Style TagStyle
|
||||
{
|
||||
get => (Style) GetValue(TagStyleProperty);
|
||||
set => SetValue(TagStyleProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ShowSelectAllButtonProperty = DependencyProperty.Register(
|
||||
"ShowSelectAllButton", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool ShowSelectAllButton
|
||||
{
|
||||
get => (bool) GetValue(ShowSelectAllButtonProperty);
|
||||
set => SetValue(ShowSelectAllButtonProperty, ValueBoxes.BooleanBox(value));
|
||||
}
|
||||
|
||||
public CheckComboBox()
|
||||
{
|
||||
AddHandler(Controls.Tag.ClosedEvent, new RoutedEventHandler(Tags_OnClosed));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) => SelectedItems.Clear()));
|
||||
}
|
||||
|
||||
private void Tags_OnClosed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Tag tag && tag.Tag is CheckComboBoxItem checkComboBoxItem)
|
||||
{
|
||||
checkComboBoxItem.SetCurrentValue(IsSelectedProperty, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
if (_selectAllItem != null)
|
||||
{
|
||||
_selectAllItem.Selected -= SelectAllItem_Selected;
|
||||
_selectAllItem.Unselected -= SelectAllItem_Unselected;
|
||||
}
|
||||
|
||||
base.OnApplyTemplate();
|
||||
|
||||
_panel = GetTemplateChild(ElementPanel) as Panel;
|
||||
_selectAllItem = GetTemplateChild(ElementSelectAll) as CheckComboBoxItem;
|
||||
if (_selectAllItem != null)
|
||||
{
|
||||
_selectAllItem.Selected += SelectAllItem_Selected;
|
||||
_selectAllItem.Unselected += SelectAllItem_Unselected;
|
||||
}
|
||||
}
|
||||
|
||||
public bool VerifyData()
|
||||
{
|
||||
OperationResult<bool> result;
|
||||
|
||||
if (VerifyFunc != null)
|
||||
{
|
||||
result = VerifyFunc.Invoke(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SelectedItems.Count > 0)
|
||||
{
|
||||
result = OperationResult.Success();
|
||||
}
|
||||
else if (InfoElement.GetNecessary(this))
|
||||
{
|
||||
result = OperationResult.Failed(Properties.Langs.Lang.IsNecessary);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = OperationResult.Success();
|
||||
}
|
||||
}
|
||||
|
||||
IsError = !result.Data;
|
||||
ErrorStr = result.Message;
|
||||
return result.Data;
|
||||
}
|
||||
|
||||
public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
|
||||
|
||||
private void SwitchAllItems(bool selected)
|
||||
{
|
||||
if (_isInternalAction) return;
|
||||
_isInternalAction = true;
|
||||
|
||||
foreach (var item in ItemContainerGenerator.Items)
|
||||
{
|
||||
if (ItemContainerGenerator.ContainerFromItem(item) is CheckComboBoxItem checkComboBoxItem)
|
||||
{
|
||||
checkComboBoxItem.SetCurrentValue(ListBoxItem.IsSelectedProperty, selected);
|
||||
}
|
||||
}
|
||||
|
||||
_isInternalAction = false;
|
||||
UpdateTags();
|
||||
}
|
||||
|
||||
private void SelectAllItem_Selected(object sender, RoutedEventArgs e) => SwitchAllItems(true);
|
||||
|
||||
private void SelectAllItem_Unselected(object sender, RoutedEventArgs e) => SwitchAllItems(false);
|
||||
|
||||
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
|
||||
{
|
||||
UpdateTags();
|
||||
VerifyData();
|
||||
|
||||
base.OnSelectionChanged(e);
|
||||
}
|
||||
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is CheckComboBoxItem;
|
||||
|
||||
protected override DependencyObject GetContainerForItemOverride() => new CheckComboBoxItem();
|
||||
|
||||
private void UpdateTags()
|
||||
{
|
||||
if (_panel == null || _isInternalAction) return;
|
||||
|
||||
if (_selectAllItem != null)
|
||||
{
|
||||
_isInternalAction = true;
|
||||
_selectAllItem.SetCurrentValue(IsSelectedProperty, SelectedItems.Count == Items.Count);
|
||||
_isInternalAction = false;
|
||||
}
|
||||
|
||||
_panel.Children.Clear();
|
||||
|
||||
foreach (var item in SelectedItems)
|
||||
{
|
||||
if (ItemContainerGenerator.ContainerFromItem(item) is CheckComboBoxItem checkComboBoxItem)
|
||||
{
|
||||
var tag = new Tag
|
||||
{
|
||||
Style = TagStyle,
|
||||
Content = checkComboBoxItem.Content,
|
||||
Tag = checkComboBoxItem
|
||||
};
|
||||
_panel.Children.Add(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class CheckComboBoxItem : ListBoxItem
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,8 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Dialog\DialogContainer.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Growl\GrowlWindow.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Image\ImageBlock.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Input\CheckComboBox\CheckComboBox.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Input\CheckComboBox\CheckComboBoxItem.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Input\ImageSelector.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Input\PinBox.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\DashBorder.cs" />
|
||||
@@ -116,6 +118,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\DoubleMinConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Number2PercentageConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Object2StringConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Object2VisibilityReConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\RectangleCircularConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\ThicknessSplitConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Extension\DependencyObjectExtension.cs" />
|
||||
@@ -440,6 +443,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\CheckComboBoxBaseStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\CheckComboBox.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\ImageSelector.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -59,7 +59,18 @@ namespace HandyControl.Properties.Langs {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 所有 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string All
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("All", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 上午 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>Miscellaneous</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>All</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>Miscellaneous</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>All</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>Miscellaneous</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>All</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>Miscellaneous</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>All</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>Geral</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>All</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>杂项</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>全部</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>Miscellaneous</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>All</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -237,4 +237,7 @@
|
||||
<data name="Miscellaneous" xml:space="preserve">
|
||||
<value>Miscellaneous</value>
|
||||
</data>
|
||||
<data name="All" xml:space="preserve">
|
||||
<value>All</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -37,7 +37,8 @@ namespace HandyControl.Properties.Langs
|
||||
|
||||
private void UpdateLangs()
|
||||
{
|
||||
OnPropertyChanged(nameof(Am));
|
||||
OnPropertyChanged(nameof(All));
|
||||
OnPropertyChanged(nameof(Am));
|
||||
OnPropertyChanged(nameof(Cancel));
|
||||
OnPropertyChanged(nameof(CannotRegisterCompositeCommandInItself));
|
||||
OnPropertyChanged(nameof(CannotRegisterSameCommandTwice));
|
||||
@@ -78,6 +79,11 @@ namespace HandyControl.Properties.Langs
|
||||
OnPropertyChanged(nameof(ZoomOut));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 所有 的本地化字符串。
|
||||
/// </summary>
|
||||
public string All => Lang.All;
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 上午 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -282,6 +288,11 @@ namespace HandyControl.Properties.Langs
|
||||
|
||||
public class LangKeys
|
||||
{
|
||||
/// <summary>
|
||||
/// 查找类似 所有 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string All = nameof(All);
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 上午 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<converter:BorderCircularClipConverter x:Key="BorderCircularClipConverter"/>
|
||||
<converter:BorderCircularConverter x:Key="BorderCircularConverter"/>
|
||||
<converter:Object2VisibilityConverter x:Key="Object2VisibilityConverter"/>
|
||||
<converter:Object2VisibilityReConverter x:Key="Object2VisibilityReConverter"/>
|
||||
<converter:Number2PercentageConverter x:Key="Number2PercentageConverter"/>
|
||||
<converter:RectangleCircularConverter x:Key="RectangleCircularConverter"/>
|
||||
<converter:ThicknessSplitConverter x:Key="ThicknessSplitConverter"/>
|
||||
|
||||
@@ -0,0 +1,621 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="clr-namespace:HandyControl.Controls"
|
||||
xmlns:ex="clr-namespace:HandyControl.Tools.Extension"
|
||||
xmlns:themes="clr-namespace:HandyControl.Themes"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
|
||||
xmlns:langs="clr-namespace:HandyControl.Properties.Langs">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/Tag.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="Tag4CheckComboBoxStyle" BasedOn="{StaticResource TagBaseStyle}" TargetType="hc:Tag">
|
||||
<Setter Property="Margin" Value="0,3,3,0"/>
|
||||
<Setter Property="Padding" Value="6,3,4,3"/>
|
||||
<Setter Property="Height" Value="Auto"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="hc:Tag">
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<Button Focusable="False" Name="ButtonClose" Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Command="interactivity:ControlCommands.Close" Margin="10,0,0,0" Width="16" Height="16" Padding="0,4" Grid.Column="1" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" Foreground="{TemplateBinding Foreground}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
||||
<Setter Property="hc:IconElement.Geometry" Value="{StaticResource DeleteFillCircleGeometry}" TargetName="ButtonClose"/>
|
||||
<Setter Property="Padding" Value="0" TargetName="ButtonClose"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CheckComboBoxToggleButton" TargetType="ToggleButton">
|
||||
<Setter Property="ClickMode" Value="Release"/>
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<Border Margin="0,0,6,0" BorderThickness="1" BorderBrush="Transparent" HorizontalAlignment="Right" SnapsToDevicePixels="true" Width="{StaticResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
|
||||
<Path Width="16" Height="9" x:Name="arrow" Data="{StaticResource DownGeometry}" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Data" TargetName="arrow" Value="{StaticResource UpGeometry}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".4"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CheckComboBoxWatermarkToggleButton" TargetType="ToggleButton">
|
||||
<Setter Property="ClickMode" Value="Release"/>
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource ThirdlyTextBrush}"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.ColumnSpan="2" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"/>
|
||||
<Path Grid.Column="1" x:Name="arrow" Data="{StaticResource DownGeometry}" Stretch="Uniform" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Center" Margin="7" VerticalAlignment="Center"/>
|
||||
<Border Margin="1" Grid.Column="0" Visibility="{Binding SelectedItem,RelativeSource={RelativeSource AncestorType=hc:CheckComboBox},Converter={StaticResource Object2VisibilityReConverter}}">
|
||||
<ContentPresenter Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Data" TargetName="arrow" Value="{StaticResource UpGeometry}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".4"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CheckComboBoxItemBaseStyle" TargetType="hc:CheckComboBoxItem">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<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="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="hc:CheckComboBoxItem">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{Binding Padding,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='1,0,1,0'}" SnapsToDevicePixels="true">
|
||||
<CheckBox Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Stretch" MinHeight="{TemplateBinding MinHeight}" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsSelected,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</CheckBox>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="CheckComboBoxTemplate" TargetType="hc:CheckComboBox">
|
||||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Popup x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" StaysOpen="False" IsOpen="{Binding IsDropDownOpen,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" AllowsTransparency="true" Grid.ColumnSpan="2" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}">
|
||||
<Grid Margin="0,4" ClipToBounds="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<hc:CheckComboBoxItem x:Name="PART_SelectAll" Style="{TemplateBinding ItemContainerStyle}" IsEnabled="{TemplateBinding ShowSelectAllButton}" Visibility="{Binding ShowSelectAllButton,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalContentAlignment="Stretch" Content="{ex:Lang Key={x:Static langs:LangKeys.All}}"/>
|
||||
<ScrollViewer x:Name="DropDownScrollViewer" Grid.Row="1">
|
||||
<hc:SimplePanel RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
|
||||
</Canvas>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</hc:SimplePanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
<ToggleButton Grid.Column="0" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" Style="{StaticResource CheckComboBoxToggleButton}"/>
|
||||
<Border Grid.Column="0" Margin="-1,1">
|
||||
<WrapPanel Name="PART_Panel" Margin="5,0,5,3"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="hc:DropDownElement.ConsistentWidth" Value="True">
|
||||
<Setter Property="MaxWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
<Setter Property="MinWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true"/>
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="toggleButton"/>
|
||||
<Condition Property="IsOpen" Value="false" SourceName="PART_Popup"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsOpen" Value="True" SourceName="PART_Popup">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="toggleButton"/>
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="PART_Panel"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="CheckComboBoxBaseStyle" TargetType="hc:CheckComboBox">
|
||||
<Setter Property="TagStyle" Value="{StaticResource Tag4CheckComboBoxStyle}"/>
|
||||
<Setter Property="SelectionMode" Value="Multiple"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource CheckComboBoxItemBaseStyle}"/>
|
||||
<Setter Property="hc: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="MinHeight" 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="{StaticResource DefaultInputPadding}"/>
|
||||
<Setter Property="Template" Value="{StaticResource CheckComboBoxTemplate}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="CheckComboBoxExtendTopTemplate" TargetType="hc:CheckComboBox">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<Popup x:Name="PART_Popup" Grid.Row="1" Grid.Column="0" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" StaysOpen="False" IsOpen="{Binding IsDropDownOpen,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}">
|
||||
<Grid Margin="0,4" ClipToBounds="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<hc:CheckComboBoxItem x:Name="PART_SelectAll" Style="{TemplateBinding ItemContainerStyle}" IsEnabled="{TemplateBinding ShowSelectAllButton}" Visibility="{Binding ShowSelectAllButton,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalContentAlignment="Stretch" Content="{ex:Lang Key={x:Static langs:LangKeys.All}}"/>
|
||||
<ScrollViewer x:Name="DropDownScrollViewer" Grid.Row="1">
|
||||
<hc:SimplePanel RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
|
||||
</Canvas>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</hc:SimplePanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
<ToggleButton Grid.Row="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/>
|
||||
<Border Grid.Row="1" Grid.Column="0" Margin="1,0">
|
||||
<WrapPanel Name="PART_Panel" Margin="3,1,3,4"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="hc:DropDownElement.ConsistentWidth" Value="True">
|
||||
<Setter Property="MaxWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
<Setter Property="MinWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true"/>
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="toggleButton"/>
|
||||
<Condition Property="IsOpen" Value="false" SourceName="PART_Popup"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsOpen" Value="True" SourceName="PART_Popup">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="toggleButton"/>
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="PART_Panel"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="CheckComboBoxExtendLeftTemplate" TargetType="hc:CheckComboBox">
|
||||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true" MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<Popup Grid.Column="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" StaysOpen="False" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}">
|
||||
<Grid Margin="0,4" ClipToBounds="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<hc:CheckComboBoxItem x:Name="PART_SelectAll" Style="{TemplateBinding ItemContainerStyle}" IsEnabled="{TemplateBinding ShowSelectAllButton}" Visibility="{Binding ShowSelectAllButton,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalContentAlignment="Stretch" Content="{ex:Lang Key={x:Static langs:LangKeys.All}}"/>
|
||||
<ScrollViewer x:Name="DropDownScrollViewer" Grid.Row="1">
|
||||
<hc:SimplePanel RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
|
||||
</Canvas>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</hc:SimplePanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
<ToggleButton Grid.Column="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/>
|
||||
<Border Grid.Column="1" Margin="1,0">
|
||||
<WrapPanel Name="PART_Panel" Margin="3,1,3,4"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="hc:DropDownElement.ConsistentWidth" Value="True">
|
||||
<Setter Property="MaxWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
<Setter Property="MinWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true"/>
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="toggleButton"/>
|
||||
<Condition Property="IsOpen" Value="false" SourceName="PART_Popup"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsOpen" Value="True" SourceName="PART_Popup">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="toggleButton"/>
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="PART_Panel"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="CheckComboBoxExtendBaseStyle" BasedOn="{StaticResource CheckComboBoxBaseStyle}" TargetType="hc:CheckComboBox">
|
||||
<Setter Property="Height" Value="Auto"/>
|
||||
<Setter Property="Template" Value="{StaticResource CheckComboBoxExtendTopTemplate}"/>
|
||||
<Setter Property="hc:InfoElement.Symbol" Value="●"/>
|
||||
<Setter Property="hc:InfoElement.ContentHeight" Value="{x:Static system:Double.NaN}"/>
|
||||
<Setter Property="hc:InfoElement.MinContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="hc:InfoElement.TitlePlacement" Value="Left">
|
||||
<Setter Property="Template" Value="{StaticResource CheckComboBoxExtendLeftTemplate}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="CheckComboBoxPlusTopTemplate" TargetType="hc:CheckComboBox">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard x:Key="StoryboardShow">
|
||||
<ThicknessAnimation Storyboard.TargetName="TextBlockError" Storyboard.TargetProperty="Margin" To="9,0,0,-18" Duration="0:0:.2"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="StoryboardHidden">
|
||||
<ThicknessAnimation Storyboard.TargetName="TextBlockError" Storyboard.TargetProperty="Margin" To="9,0,0,4" Duration="0:0:0"/>
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<Popup Grid.Row="1" Grid.Column="0" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" StaysOpen="False" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}">
|
||||
<Grid Margin="0,4" ClipToBounds="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<hc:CheckComboBoxItem x:Name="PART_SelectAll" Style="{TemplateBinding ItemContainerStyle}" IsEnabled="{TemplateBinding ShowSelectAllButton}" Visibility="{Binding ShowSelectAllButton,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalContentAlignment="Stretch" Content="{ex:Lang Key={x:Static langs:LangKeys.All}}"/>
|
||||
<ScrollViewer x:Name="DropDownScrollViewer" Grid.Row="1">
|
||||
<hc:SimplePanel RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
|
||||
</Canvas>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</hc:SimplePanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
<TextBlock Grid.Column="0" Grid.ColumnSpan="2" FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Row="1"/>
|
||||
<ToggleButton Grid.Row="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/>
|
||||
<Border Grid.Row="1" Grid.Column="0" Margin="1,0">
|
||||
<WrapPanel Name="PART_Panel" Margin="3,1,3,4"/>
|
||||
</Border>
|
||||
<Button Grid.Row="1" Command="interactivity:ControlCommands.Clear" Margin="0,0,26,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{TemplateBinding BorderBrush}"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="hc:DropDownElement.ConsistentWidth" Value="True">
|
||||
<Setter Property="MaxWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
<Setter Property="MinWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true"/>
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="toggleButton"/>
|
||||
<Condition Property="IsOpen" Value="false" SourceName="PART_Popup"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="ButtonClear"/>
|
||||
<Condition Property="IsOpen" Value="false" SourceName="PART_Popup"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="toggleButton"/>
|
||||
<Condition Property="ShowClearButton" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonClear"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="ButtonClear"/>
|
||||
<Condition Property="ShowClearButton" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonClear"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsOpen" Value="True" SourceName="PART_Popup">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsError" Value="true">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}"/>
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource StoryboardShow}"/>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource StoryboardHidden}"/>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="toggleButton"/>
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="PART_Panel"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="CheckComboBoxPlusLeftTemplate" TargetType="hc:CheckComboBox">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard x:Key="StoryboardShow">
|
||||
<ThicknessAnimation Storyboard.TargetName="TextBlockError" Storyboard.TargetProperty="Margin" To="9,0,0,-18" Duration="0:0:.2"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="StoryboardHidden">
|
||||
<ThicknessAnimation Storyboard.TargetName="TextBlockError" Storyboard.TargetProperty="Margin" To="9,0,0,4" Duration="0:0:0"/>
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true" MinHeight="{Binding Path=(hc:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(hc:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
<Popup Grid.Column="1" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=toggleButton}" AllowsTransparency="true" Grid.ColumnSpan="2" StaysOpen="False" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}">
|
||||
<Grid Margin="0,4" ClipToBounds="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<hc:CheckComboBoxItem x:Name="PART_SelectAll" Style="{TemplateBinding ItemContainerStyle}" IsEnabled="{TemplateBinding ShowSelectAllButton}" Visibility="{Binding ShowSelectAllButton,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalContentAlignment="Stretch" Content="{ex:Lang Key={x:Static langs:LangKeys.All}}"/>
|
||||
<ScrollViewer x:Name="DropDownScrollViewer" Grid.Row="1">
|
||||
<hc:SimplePanel RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
|
||||
</Canvas>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</hc:SimplePanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
<TextBlock Grid.Column="1" Grid.ColumnSpan="2" FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}"/>
|
||||
<ToggleButton Grid.Column="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/>
|
||||
<Border Grid.Column="1" Margin="1,0">
|
||||
<WrapPanel Name="PART_Panel" Margin="3,1,3,4"/>
|
||||
</Border>
|
||||
<Button Command="interactivity:ControlCommands.Clear" Margin="0,0,26,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{TemplateBinding BorderBrush}"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="hc:DropDownElement.ConsistentWidth" Value="True">
|
||||
<Setter Property="MaxWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
<Setter Property="MinWidth" TargetName="dropDownBorder" Value="{Binding ActualWidth, ElementName=toggleButton}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true"/>
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="toggleButton"/>
|
||||
<Condition Property="IsOpen" Value="false" SourceName="PART_Popup"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="ButtonClear"/>
|
||||
<Condition Property="IsOpen" Value="false" SourceName="PART_Popup"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="toggleButton"/>
|
||||
<Condition Property="ShowClearButton" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonClear"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="true" SourceName="ButtonClear"/>
|
||||
<Condition Property="ShowClearButton" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="ButtonClear"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsOpen" Value="True" SourceName="PART_Popup">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsError" Value="true">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}"/>
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource StoryboardShow}"/>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource StoryboardHidden}"/>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="toggleButton"/>
|
||||
<Setter Property="Opacity" Value="0.4" TargetName="PART_Panel"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="CheckComboBoxPlusBaseStyle" BasedOn="{StaticResource CheckComboBoxExtendBaseStyle}" TargetType="hc:CheckComboBox">
|
||||
<Setter Property="Template" Value="{StaticResource CheckComboBoxPlusTopTemplate}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="hc:InfoElement.TitlePlacement" Value="Left">
|
||||
<Setter Property="Template" Value="{StaticResource CheckComboBoxPlusLeftTemplate}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,16 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="clr-namespace:HandyControl.Controls"
|
||||
xmlns:themes="clr-namespace:HandyControl.Themes">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style BasedOn="{StaticResource CheckComboBoxBaseStyle}" TargetType="hc:CheckComboBox"/>
|
||||
|
||||
<Style x:Key="CheckComboBoxExtend" BasedOn="{StaticResource CheckComboBoxExtendBaseStyle}" TargetType="hc:CheckComboBox"/>
|
||||
|
||||
<Style x:Key="CheckComboBoxPlus" BasedOn="{StaticResource CheckComboBoxPlusBaseStyle}" TargetType="hc:CheckComboBox"/>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -25,6 +25,7 @@
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/Expander.xaml"/>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/TextBox.xaml"/>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/ComboBox.xaml"/>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/CheckComboBox.xaml"/>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/CheckBox.xaml"/>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/RadioButton.xaml"/>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/NumericUpDown.xaml"/>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace HandyControl.Tools.Converter
|
||||
{
|
||||
public class Object2VisibilityReConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value == null ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user