-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
50 lines (50 loc) · 2.5 KB
/
MainWindow.xaml
File metadata and controls
50 lines (50 loc) · 2.5 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<Window x:Class="HowToCreateLookUpEdit.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:HowToCreateLookUpEdit"
Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
<local:ProductListViewModel/>
</Window.DataContext>
<dxmvvm:Interaction.Behaviors>
<dx:DialogService DialogWindowStartupLocation="CenterOwner">
<dx:DialogService.ViewTemplate>
<DataTemplate>
<dxlc:DataLayoutControl CurrentItem="{Binding}"
Orientation="Vertical"/>
</DataTemplate>
</dx:DialogService.ViewTemplate>
<dx:DialogService.DialogStyle>
<Style TargetType="Window">
<Setter Property="Width" Value="300"/>
<Setter Property="Height" Value="400"/>
</Style>
</dx:DialogService.DialogStyle>
</dx:DialogService>
</dxmvvm:Interaction.Behaviors>
<Grid>
<dxg:LookUpEdit x:Name="lookUpEdit" Width="200"
ItemsSource="{Binding Products}"
HorizontalAlignment="Center" VerticalAlignment="Center"
DisplayMember="ProductName"
ValueMember="ID"
AddNewButtonPlacement="Popup"
ImmediatePopup="True"
IsPopupAutoWidth="False">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="ProcessNewValue"
Command="{Binding ShowProductFormCommand}"
PassEventArgsToCommand="True"
SourceName="lookUpEdit">
<dxmvvm:EventToCommand.EventArgsConverter>
<local:ProductListValueConverter/>
</dxmvvm:EventToCommand.EventArgsConverter>
</dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</dxg:LookUpEdit>
</Grid>
</Window>