15
15
<Design .DataContext>
16
16
<vm : MainWindowViewModel />
17
17
</Design .DataContext>
18
+
19
+ <Window .DataTemplates>
20
+ <DataTemplate DataType =" models:Sample3Model" >
21
+ <StackPanel >
22
+ <TextBlock TextAlignment =" Center" >Your lucky number:</TextBlock >
23
+ <TextBlock Classes =" Body1"
24
+ TextAlignment =" Center"
25
+ Text =" {Binding Number}" />
26
+ <Button Margin =" 0 8 0 0"
27
+ Command =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
28
+ THANKS, CLOSE
29
+ </Button >
30
+ </StackPanel >
31
+ </DataTemplate >
32
+ </Window .DataTemplates>
33
+ <Window .Resources>
34
+ <StackPanel x : Key =" Sample2View" >
35
+ <TextBlock >It opened without animation</TextBlock >
36
+ <Button Margin =" 0 16 0 0"
37
+ Command =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
38
+ CLOSE
39
+ </Button >
40
+ </StackPanel >
41
+ <StackPanel x : Key =" Sample3View" >
42
+ <ProgressBar Classes =" Circle" IsIndeterminate =" True" />
43
+ <Button Margin =" 0 16 0 0"
44
+ Command =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
45
+ CLOSE
46
+ </Button >
47
+ </StackPanel >
48
+ <StackPanel x : Key =" Sample4View" >
49
+ <TextBlock >Everything blurred</TextBlock >
50
+ <Button Margin =" 0 16 0 0"
51
+ Command =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
52
+ CLOSE
53
+ </Button >
54
+ </StackPanel >
55
+ </Window .Resources>
56
+
18
57
<dialogHostAvalonia : DialogHost Identifier =" MainDialogHost"
19
58
DialogMargin =" 16"
20
59
dialogHostAvalonia:DialogHostStyle.CornerRadius=" 8" >
21
- <dialogHostAvalonia : DialogHost .DataTemplates>
22
- <DataTemplate DataType =" models:Sample2Model" >
23
- <StackPanel >
24
- <TextBlock TextAlignment =" Center" >Your lucky number:</TextBlock >
25
- <TextBlock Classes =" Body1"
26
- TextAlignment =" Center"
27
- Text =" {Binding Number}" />
28
- <Button Margin =" 0 8 0 0"
29
- Command =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
30
- THANKS, CLOSE
31
- </Button >
32
- </StackPanel >
33
- </DataTemplate >
34
- </dialogHostAvalonia : DialogHost .DataTemplates>
35
60
<Grid Margin =" 8"
36
61
ColumnDefinitions =" * 8 * 8 * 8 *" RowDefinitions =" Auto 8 *"
37
62
VerticalAlignment =" Center" HorizontalAlignment =" Stretch" >
94
119
</Border >
95
120
</Grid >
96
121
</dialogHostAvalonia : DialogHost >
97
- <Window .Resources>
98
- <StackPanel x : Key =" Sample2View" >
99
- <TextBlock >It opened without animation</TextBlock >
100
- <Button Margin =" 0 16 0 0"
101
- Command =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
102
- CLOSE
103
- </Button >
104
- </StackPanel >
105
- <StackPanel x : Key =" Sample3View" >
106
- <ProgressBar Classes =" Circle" IsIndeterminate =" True" />
107
- <Button Margin =" 0 16 0 0"
108
- Command =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
109
- CLOSE
110
- </Button >
111
- </StackPanel >
112
- </Window .Resources>
113
122
</Window >
0 commit comments