forked from elmish/Elmish.WPF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
31 lines (31 loc) · 1.67 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
<Window x:Class="Elmish.WPF.Samples.OneWaySeq.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Elmish.WPF.Samples.OneWaySeq;assembly=OneWaySeq.Core"
Title="OneWaySeq"
Height="400"
Width="400"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d"
d:DataContext="{x:Static vm:Program.designVm}">
<StackPanel>
<TextBlock
Text="This sample shows the difference between Binding.oneWay and Binding.oneWaySeq. For oneWay, the whole ListView is re-rendered for every change. For oneWaySeq, only the new item is added."
Margin="10,20,10,10"
TextWrapping="Wrap" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<StackPanel Margin="0,0,50,0">
<TextBlock Text="Binding.oneWay" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,0,0,10" />
<Button Command="{Binding AddOneWayNumber}" Content="Add number" Width="150" Margin="0,0,0,20" />
<ListView ItemsSource="{Binding OneWayNumbers}" />
</StackPanel>
<StackPanel>
<TextBlock Text="Binding.oneWaySeq" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,0,0,10" />
<Button Command="{Binding AddOneWaySeqNumber}" Content="Add number" Width="150" Margin="0,0,0,20" />
<ListView ItemsSource="{Binding OneWaySeqNumbers}" />
</StackPanel>
</StackPanel>
</StackPanel>
</Window>