mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-05-03 14:31:28 +08:00
流程控制,前台可以模拟审批
This commit is contained in:
30
Util.DiagramDesigner/Converters/InvertBoolConverter.cs
Normal file
30
Util.DiagramDesigner/Converters/InvertBoolConverter.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace Util.DiagramDesigner
|
||||
{
|
||||
public class InvertBoolConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Returns the value for the target property of this markup extension.
|
||||
/// </summary>
|
||||
/// <param name="serviceProvider">Object that can provide services for the markup extension.</param>
|
||||
/// <returns>Reference to the instance of this Int32IndexToNumberConverter.</returns>
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return !(bool)value;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return !(bool)value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,8 @@
|
||||
<s:ArrowSizeConverter x:Key="ArrowSizeConverter"/>
|
||||
<s:LineDashConverter x:Key="LineDashConverter"/>
|
||||
<s:ClipConverter x:Key="ClipConverter"/>
|
||||
|
||||
<s:InvertBoolConverter x:Key="InvertBoolConverter"/>
|
||||
|
||||
<!-- ResizeDecorator Default Template -->
|
||||
<!--
|
||||
<ControlTemplate x:Key="ResizeDecoratorTemplate" TargetType="{x:Type Control}">
|
||||
@@ -376,7 +377,7 @@
|
||||
VerticalAlignment="Stretch"
|
||||
Content="{TemplateBinding Content}" />
|
||||
|
||||
<Control x:Name="PART_Text" Margin="5">
|
||||
<Control x:Name="PART_Text" Margin="5" IsHitTestVisible="{Binding IsReadOnlyText,Converter={StaticResource InvertBoolConverter}}">
|
||||
<Control.Style>
|
||||
<Style TargetType="Control">
|
||||
<Setter Property="Template">
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<TextBox x:Name="PART_ShowText"
|
||||
Text="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Foreground="{Binding FontViewModel.FontColor,Converter={StaticResource ColorBrushConverter}}"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
IsReadOnly="{Binding IsReadOnlyText}"
|
||||
FontSize="{Binding FontViewModel.FontSize}"
|
||||
FontFamily="{Binding FontViewModel.FontFamily}"
|
||||
FontWeight="{Binding FontViewModel.FontWeight}"
|
||||
|
||||
@@ -234,6 +234,21 @@ namespace Util.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isReadOnlyText = false;
|
||||
public bool IsReadOnlyText
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsReadOnly)
|
||||
return true;
|
||||
return _isReadOnlyText;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _isReadOnlyText, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _showText;
|
||||
public virtual bool ShowText
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user