-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml
83 lines (76 loc) · 4.78 KB
/
App.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
73
74
75
76
77
78
79
80
81
82
83
<prism:PrismApplication x:Class="UnitPlanGenerator.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:converter="clr-namespace:UnitPlanGenerator.Converters"
xmlns:templateSelector="clr-namespace:UnitPlanGenerator.TemplateSelectors"
xmlns:model="clr-namespace:UnitPlanGenerator.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:UnitPlanGenerator">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources />
<ui:XamlControlsResources />
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converter:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<converter:EqualityToVisibilityConverter x:Key="EqualityToVisibilityConverter" />
<templateSelector:SubjectTemplateSelector x:Key="SubjectTemplateSelector" />
<converter:DatabaseProviderToStringConverter x:Key="DatabaseProviderToStringConverter" />
<ObjectDataProvider x:Key="DatabaseProviderItems"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="model:DatabaseProvider"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<DataTemplate DataType="{x:Type model:DatabaseProvider}">
<ContentPresenter Content="{Binding Converter={StaticResource DatabaseProviderToStringConverter}}" />
</DataTemplate>
<converter:UserRoleToStringConverter x:Key="UserRoleToStringConverter" />
<DataTemplate DataType="{x:Type model:Role}">
<ContentPresenter Content="{Binding Converter={StaticResource UserRoleToStringConverter}}" />
</DataTemplate>
<converter:SubjectTypeConverter x:Key="SubjectTypeConverter" />
<ObjectDataProvider x:Key="SubjectTypeItems"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="model:SubjectType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<DataTemplate DataType="{x:Type model:SubjectType}">
<ContentPresenter Content="{Binding Converter={StaticResource SubjectTypeConverter}}" />
</DataTemplate>
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBoxStyle}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="False">
<Setter Property="ui:ControlHelper.Description"
Value=" " />
</Trigger>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="ui:ControlHelper.Description"
Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)/ErrorContent}" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type PasswordBox}" BasedOn="{StaticResource DefaultPasswordBoxStyle}">
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="False">
<Setter Property="ui:ControlHelper.Description"
Value=" " />
</Trigger>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="ui:ControlHelper.Description"
Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)/ErrorContent}" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</Application.Resources>
</prism:PrismApplication>