| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <Window xmlns="https://github.com/perspex"
- xmlns:vm="clr-namespace:BindingTest.ViewModels;assembly=BindingTest">
- <TabControl>
- <TabItem Header="Basic">
- <StackPanel Orientation="Horizontal">
- <StackPanel Margin="18" Gap="4" Width="200">
- <TextBlock FontSize="16" Text="Simple Bindings"/>
- <TextBox Watermark="Two Way" UseFloatingWatermark="True" Text="{Binding StringValue}"/>
- <TextBox Watermark="One Way" UseFloatingWatermark="True" Text="{Binding Path=StringValue, Mode=OneWay}"/>
- <TextBox Watermark="One Time" UseFloatingWatermark="True" Text="{Binding Path=StringValue, Mode=OneTime}"/>
- <TextBox Watermark="One Way To Source" UseFloatingWatermark="True" Text="{Binding Path=StringValue, Mode=OneWayToSource}"/>
- </StackPanel>
- <StackPanel Margin="18" Gap="4" Width="200">
- <TextBlock FontSize="16" Text="Collection Bindings"/>
- <TextBox Watermark="Items[1].StringValue" UseFloatingWatermark="True" Text="{Binding Items[1].StringValue}"/>
- <Button Command="{Binding ShuffleItems}">Shuffle</Button>
- </StackPanel>
- <StackPanel Margin="18" Gap="4" Width="200">
- <TextBlock FontSize="16" Text="Negated Bindings"/>
- <TextBox Watermark="Boolean String" UseFloatingWatermark="True" Text="{Binding BooleanString}"/>
- <CheckBox IsChecked="{Binding !BooleanString}">!BooleanString</CheckBox>
- <CheckBox IsChecked="{Binding !!BooleanString}">!!BooleanString</CheckBox>
- </StackPanel>
- </StackPanel>
- </TabItem>
- <TabItem Header="ListBox">
- <StackPanel Orientation="Horizontal">
- <StackPanel.DataTemplates>
- <DataTemplate DataType="vm:TestItem">
- <TextBlock Text="{Binding StringValue}"/>
- </DataTemplate>
- </StackPanel.DataTemplates>
- <StackPanel Margin="18" Gap="4" Width="200">
- <TextBlock FontSize="16" Text="Multiple"/>
- <ListBox Items="{Binding Items}" SelectionMode="Multiple" SelectedItems="{Binding SelectedItems}"/>
- </StackPanel>
- <StackPanel Margin="18" Gap="4" Width="200">
- <TextBlock FontSize="16" Text="Multiple"/>
- <ListBox Items="{Binding Items}" SelectionMode="Multiple" SelectedItems="{Binding SelectedItems}"/>
- </StackPanel>
- </StackPanel>
- </TabItem>
- </TabControl>
- </Window>
|