-
Notifications
You must be signed in to change notification settings - Fork 13
/
AdvancedMessageBox.xaml
44 lines (44 loc) · 2.03 KB
/
AdvancedMessageBox.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
<Window x:Class="CnCNet.LauncherStub.AdvancedMessageBox"
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:CnCNet.LauncherStub"
mc:Ignorable="d"
Title="{Binding Title}"
d:Title="Message title goes here"
SizeToContent="WidthAndHeight"
Height="200" MaxHeight="600"
Width="350" MinWidth="300" MaxWidth="800"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize">
<Window.DataContext>
<local:AdvancedMessageBoxViewModel />
</Window.DataContext>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Bottom" Margin="10,0,10,10">
<ItemsControl ItemsSource="{Binding Commands}">
<!-- https://stackoverflow.com/a/68096372/7774607 -->
<d:ItemsControl.ItemsSource>
<x:Array Type="{x:Type local:CommandViewModel}">
<local:CommandViewModel />
<local:CommandViewModel />
<local:CommandViewModel />
</x:Array>
</d:ItemsControl.ItemsSource>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Margin="0,5,0,5" Content="{Binding Text}"
d:Content="Button text here"
Command="{Binding Command}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<TextBlock DockPanel.Dock="Top" Margin="10" Text="{Binding Message}"
d:Text="Message text goes here."
TextWrapping="Wrap" />
</DockPanel>
</ScrollViewer>
</Window>