11 files changed
+34
-37
No files matched your search
+3
-3
@@ -3,13 +3,13 @@ using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class PasswordBoxMonitor
|
||||
public class PasswordBoxAttach
|
||||
{
|
||||
/// <summary>
|
||||
/// 密码长度
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty PasswordLengthProperty = DependencyProperty.RegisterAttached(
|
||||
"PasswordLength", typeof(int), typeof(PasswordBoxMonitor), new PropertyMetadata(ValueBoxes.Int0Box));
|
||||
"PasswordLength", typeof(int), typeof(PasswordBoxAttach), new PropertyMetadata(ValueBoxes.Int0Box));
|
||||
|
||||
public static void SetPasswordLength(DependencyObject element, int value) => element.SetValue(PasswordLengthProperty, value);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace HandyControl.Controls
|
||||
/// 是否监测
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty IsMonitoringProperty = DependencyProperty.RegisterAttached(
|
||||
"IsMonitoring", typeof(bool), typeof(PasswordBoxMonitor), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnIsMonitoringChanged));
|
||||
"IsMonitoring", typeof(bool), typeof(PasswordBoxAttach), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnIsMonitoringChanged));
|
||||
|
||||
private static void OnIsMonitoringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -17,7 +17,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\IconSwitchElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\InfoElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxMonitor.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\RelativePanel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeTrack.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeThumb.cs" />
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<ScrollViewer Margin="-1,1" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="1" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="controls:PasswordBoxMonitor.PasswordLength" Value="0">
|
||||
<Trigger Property="controls:PasswordBoxAttach.PasswordLength" Value="0">
|
||||
<Setter Property="Visibility" TargetName="placeholder" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
@@ -97,7 +97,7 @@
|
||||
<ScrollViewer Margin="-1,1" Padding="{TemplateBinding Padding}" Grid.Column="1" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="controls:PasswordBoxMonitor.PasswordLength" Value="0">
|
||||
<Trigger Property="controls:PasswordBoxAttach.PasswordLength" Value="0">
|
||||
<Setter Property="Visibility" TargetName="placeholder" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
@@ -119,7 +119,7 @@
|
||||
<Setter Property="Padding" Value="7,6"/>
|
||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||
<Setter Property="controls:InfoElement.ContentHeight" Value="30.0"/>
|
||||
<Setter Property="controls:PasswordBoxMonitor.IsMonitoring" Value="True"/>
|
||||
<Setter Property="controls:PasswordBoxAttach.IsMonitoring" Value="True"/>
|
||||
<Setter Property="Template" Value="{StaticResource PasswordBoxExtendTopTemplate}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||
@@ -146,7 +146,7 @@
|
||||
<ScrollViewer Padding="{TemplateBinding Padding}" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
</controls:SimplePanel>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="controls:PasswordBoxMonitor.PasswordLength" Value="0">
|
||||
<Trigger Property="controls:PasswordBoxAttach.PasswordLength" Value="0">
|
||||
<Setter Property="Visibility" TargetName="placeholder" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
@@ -296,7 +296,7 @@
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultInputPadding}"/>
|
||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||
<Setter Property="controls:PasswordBoxMonitor.IsMonitoring" Value="True"/>
|
||||
<Setter Property="controls:PasswordBoxAttach.IsMonitoring" Value="True"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Template" Value="{StaticResource PasswordBoxPlusTopTemplate}"/>
|
||||
<Style.Triggers>
|
||||
|
||||
Reference in new issue
Block a user