-
Notifications
You must be signed in to change notification settings - Fork 6
/
ResourcesDictionary.xaml
72 lines (72 loc) · 5.05 KB
/
ResourcesDictionary.xaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:WPFRssFeedReader.ValueConverters"
xmlns:controls="clr-namespace:WPFRssFeedReader.Controls">
<BitmapImage x:Key="CollapsedImageSource" UriSource="/Resources/Images/Collapsed.png" />
<BitmapImage x:Key="ExpandedImageSource" UriSource="/Resources/Images/Expanded.png" />
<BitmapImage x:Key="InformationImageSource" UriSource="/Resources/Images/Information.png" />
<local:ValidationObjectSeverityToColorConverter x:Key="ValidationObjectSeverityToColorConverter"/>
<local:RelationalOperatorsConverter x:Key="RelationalOperatorsConverter"/>
<Style x:Key="ListBoxItemHeader" TargetType="{x:Type TextBlock}">
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<Style x:Key="ActionIconButton" TargetType="{x:Type Button}">
<Setter Property="Background" Value="White"/>
<Setter Property="Width" Value="19" />
<Setter Property="Height" Value="19" />
<Setter Property="BorderBrush" Value="White" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
</Style>
<Style x:Key="NonSelectableListBoxItem" TargetType="ListBox">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
</Style.Resources>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="50" />
</Style>
<Style TargetType="ListBox">
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<DockPanel HorizontalAlignment="Stretch">
<Border BorderBrush="{Binding ErrorContent.Severity, Converter={StaticResource ValidationObjectSeverityToColorConverter}}" BorderThickness="1">
<AdornedElementPlaceholder Name="originalTextbox" />
</Border>
<controls:ConditionalVisibilityControl>
<TextBlock Text="*" DockPanel.Dock="Right" Foreground="{Binding ErrorContent.Severity, Converter={StaticResource ValidationObjectSeverityToColorConverter}}"
FontSize="11pt" FontWeight="Bold"
controls:ConditionalVisibilityControl.IsVisible="{Binding Source={x:Reference originalTextbox}, Path=AdornedElement.(Validation.Errors).Count, Converter={StaticResource RelationalOperatorsConverter}, ConverterParameter='equal,1'}">
<TextBlock.ToolTip>
<TextBlock Text="{Binding ErrorContent.Message}"
Foreground="{Binding ErrorContent.Severity, Converter={StaticResource ValidationObjectSeverityToColorConverter}}"
FontSize="11pt" FontWeight="Bold"/>
</TextBlock.ToolTip>
</TextBlock>
<Image Source="{StaticResource InformationImageSource}"
controls:ConditionalVisibilityControl.IsVisible="{Binding Source={x:Reference originalTextbox}, Path=AdornedElement.(Validation.Errors).Count, Converter={StaticResource RelationalOperatorsConverter}, ConverterParameter='greater than or equal,2'}">
<Image.ToolTip>
<ItemsControl ItemsSource="{Binding Source={x:Reference originalTextbox}, Path=AdornedElement.(Validation.Errors)}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ErrorContent.Message}"
Foreground="{Binding ErrorContent.Severity, Converter={StaticResource ValidationObjectSeverityToColorConverter}}"
FontSize="11pt" FontWeight="Bold"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Image.ToolTip>
</Image>
</controls:ConditionalVisibilityControl>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>