-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPercentilSettings.xaml
55 lines (51 loc) · 2.56 KB
/
PercentilSettings.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
<Window x:Class="WomenConsulting.PercentilSettings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WomenConsulting"
mc:Ignorable="d"
Title="Ввод данных для перцентильных коридоров" Height="450" Width="800" Closing="Window_Closing" Icon="Шаблоны/Иконка.png" Closed="Window_Closed">
<Window.Resources>
<ControlTemplate x:Key="validationTemplate">
<DockPanel>
<TextBlock Foreground="Red" FontSize="27"/>
<AdornedElementPlaceholder/>
</DockPanel>
</ControlTemplate>
<Style x:Key="textBoxInError" TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Errors)/ErrorContent}"/>
<Setter Property="Foreground"
Value="Red"/>
<Setter Property="BorderBrush"
Value="Red"/>
</Trigger>
<DataTrigger Binding="{Binding Path = IsEnable}" Value="false">
<Setter Property="IsEnabled"
Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
<DataTemplate x:Key="WeekViewPercentil">
<GroupBox Header="{Binding Path=DisplayName}" FontSize="24">
<TextBox x:Name="ItemTextBox"
Validation.ErrorTemplate="{StaticResource validationTemplate}"
Style="{StaticResource textBoxInError}">
<TextBox.Text>
<Binding Path="Value">
<Binding.ValidationRules>
<local:NumberValidator Min="0"/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</GroupBox>
</DataTemplate>
</Window.Resources>
<ListBox x:Name="weekParcentils" ItemsSource="{Binding Path=WeekViews}" ItemTemplate="{StaticResource WeekViewPercentil}">
</ListBox>
</Window>