mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-12-02 11:57:37 +08:00
add ShowEmpty prop for Empty control
This commit is contained in:
parent
cabd4bd12e
commit
378af385e4
@ -8232,6 +8232,7 @@
|
||||
<Setter Property="Description" Value="{StaticResource DescriptionTextBlock4Empty}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Visibility" Value="{Binding Path=(hc:Empty.ShowEmpty),RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="hc:Empty">
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@ -22,5 +23,14 @@ namespace HandyControl.Controls
|
||||
get => GetValue(LogoProperty);
|
||||
set => SetValue(LogoProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ShowEmptyProperty = DependencyProperty.RegisterAttached(
|
||||
"ShowEmpty", typeof(bool), typeof(Empty), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits));
|
||||
|
||||
public static void SetShowEmpty(DependencyObject element, bool value)
|
||||
=> element.SetValue(ShowEmptyProperty, value);
|
||||
|
||||
public static bool GetShowEmpty(DependencyObject element)
|
||||
=> (bool) element.GetValue(ShowEmptyProperty);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,12 @@
|
||||
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
|
||||
xmlns:ex="clr-namespace:HandyControl.Tools.Extension"
|
||||
xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:hc="clr-namespace:HandyControl.Controls">
|
||||
xmlns:hc="clr-namespace:HandyControl.Controls"
|
||||
xmlns:themes="clr-namespace:HandyControl.Themes">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Basic/Converters.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<DrawingBrush x:Key="EmptySimpleLogo" o:Freeze="True">
|
||||
<DrawingBrush.Drawing>
|
||||
@ -24,6 +29,7 @@
|
||||
<Setter Property="Description" Value="{StaticResource DescriptionTextBlock4Empty}"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Visibility" Value="{Binding Path=(hc:Empty.ShowEmpty),RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="hc:Empty">
|
||||
|
@ -8350,6 +8350,7 @@
|
||||
<Setter Property="Description" Value="{StaticResource DescriptionTextBlock4Empty}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Visibility" Value="{Binding Path=(hc:Empty.ShowEmpty),RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="hc:Empty">
|
||||
|
Loading…
Reference in New Issue
Block a user