This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
/
MainWindow.xaml
46 lines (38 loc) · 2.93 KB
/
MainWindow.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
<Window x:Class="WPFCustomValidationErrorPresenter.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
Title="Error presenter customization example" Height="400" Width="230" >
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WPFCustomValidationErrorPresenter;component/Themes/EditorsCustomTemplates.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Orientation="Horizontal" Margin="5,7">
<StackPanel>
<TextBlock Text="TextEdit:" Margin="5,0"/>
<dxe:TextEdit Name="TextEdit" TabIndex="0" Text="123456" Validate="textEdit_Validate" InvalidValueBehavior="AllowLeaveEditor" HorizontalAlignment="Left" Width="200"/>
<StackPanel Orientation="Horizontal" Height="15">
<TextBlock Text="Error type: " Visibility="{Binding ElementName=TextEdit, Path=HasValidationError, Converter={StaticResource BoolToVisibilityConverter}}"/>
<TextBlock Text="{Binding ElementName=TextEdit, Path=ValidationError.ErrorType}"/>
</StackPanel>
<TextBlock Text="PasswordBoxEdit:" Margin="5,10,0,0" />
<dxe:PasswordBoxEdit Name="passwordBoxEdit1" Validate="textEdit_Validate" InvalidValueBehavior="AllowLeaveEditor" HorizontalAlignment="Left" Width="200"/>
<TextBlock Text="ButtonEdit:" Margin="5,10,0,0" />
<dxe:ButtonEdit Validate="textEdit_Validate" InvalidValueBehavior="AllowLeaveEditor" Name="buttonEdit1" HorizontalAlignment="Left" Width="200"/>
<TextBlock Text="ComboBoxEdit:" Margin="5,10,0,0" />
<dxe:ComboBoxEdit Validate="textEdit_Validate" InvalidValueBehavior="AllowLeaveEditor" HorizontalAlignment="Left" Width="200">
</dxe:ComboBoxEdit>
<TextBlock Text="SpinEdit:" Margin="5,10,0,0" />
<dxe:SpinEdit Name="spinEdit1" Validate="textEdit_Validate" InvalidValueBehavior="AllowLeaveEditor" HorizontalAlignment="Left" Width="200" />
<TextBlock Text="PopupCalcEdit:" Margin="5,10,0,0" />
<dxe:PopupCalcEdit Name="popupCalcEdit1" Validate="textEdit_Validate" InvalidValueBehavior="AllowLeaveEditor" HorizontalAlignment="Left" Width="200" />
<TextBlock Text="LookUpEdit:" Margin="5,10,0,0" />
<dxg:LookUpEdit Name="lookUpEdit1" ValidateOnTextInput="True" Validate="textEdit_Validate" InvalidValueBehavior="AllowLeaveEditor" HorizontalAlignment="Left" Width="200" />
</StackPanel>
</StackPanel>
</Window>