-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCheckboxWithNote.xaml
More file actions
33 lines (33 loc) · 1.88 KB
/
CheckboxWithNote.xaml
File metadata and controls
33 lines (33 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<UserControl x:Class="RegExpressLibrary.UI.CheckboxWithNote"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:RegExpressLibrary.UI"
mc:Ignorable="d"
d:DesignHeight="18" d:DesignWidth="200"
x:Name="userControl" DataContextChanged="userControl_DataContextChanged"
>
<CheckBox IsChecked="{Binding IsChecked, ElementName=userControl}" HorizontalAlignment="Left">
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="Wrap">
<Run x:Name="run" Text="Sample text"/>
<Run>
<Run.Style>
<Style TargetType="Run">
<Setter Property="Text" Value="{Binding Note, ElementName=userControl, Mode=OneWay, FallbackValue='', StringFormat=' – {0}'}"/>
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Opacity="0.77" Color="{x:Static SystemColors.ControlTextColor}"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Note, ElementName=userControl, Mode=OneWay}" Value="">
<Setter Property="Text" Value=""/>
</DataTrigger>
</Style.Triggers>
</Style>
</Run.Style>
</Run>
</TextBlock>
</CheckBox>
</UserControl>