Files
aistudio-wpf-diagram/Extensions/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml
2023-04-16 20:11:40 +08:00

58 lines
3.7 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls">
<Style x:Key="RemarkControlStyle" TargetType="{x:Type controls:RemarkControl}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Foreground" Value="Green"/>
<Setter Property="Margin" Value="3" />
<Setter Property="Padding" Value="1" />
<Setter Property="Width" Value="12" />
<Setter Property="Height" Value="12" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:RemarkControl}">
<Border Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="true">
<TextBlock Background="{TemplateBinding Background}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Hyperlink
x:Name="PART_InnerHyperlink"
NavigateUri="{Binding RelativeSource= {RelativeSource TemplatedParent}, Path=Url}"
TextDecorations ="None"
Command="{Binding RelativeSource= {RelativeSource TemplatedParent}, Path=Command}"
CommandParameter="{Binding RelativeSource= {RelativeSource TemplatedParent}, Path=CommandParameter}"
CommandTarget="{Binding RelativeSource= {RelativeSource TemplatedParent}, Path=CommandTarget}">
<Path Stretch="Uniform" Fill="{Binding RelativeSource= {RelativeSource TemplatedParent}, Path=Foreground}"
Data="M125 125V875H875V125H125ZM812.5 812.5H187.5V187.5H812.5V812.5ZM250 687.5H625V625H250V687.5ZM750 500H250V562.5H750V500ZM750 375H250V437.5H750V375Z"></Path>
</Hyperlink>
</TextBlock>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Yellow"/>
</Trigger>
<Trigger SourceName="PART_InnerHyperlink" Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:RemarkControl}" BasedOn="{StaticResource RemarkControlStyle}" />
</ResourceDictionary>