Parcourir la source

Add `Add`, `Remove` buttons and `SelectionMode` combobox to ListBoxPage.xaml

Ivan Kochurkin il y a 6 ans
Parent
commit
1707496b3f
1 fichiers modifiés avec 14 ajouts et 1 suppressions
  1. 14 1
      samples/ControlCatalog/Pages/ListBoxPage.xaml

+ 14 - 1
samples/ControlCatalog/Pages/ListBoxPage.xaml

@@ -9,7 +9,20 @@
               Margin="0,16,0,0"
               HorizontalAlignment="Center"
               Spacing="16">
-      <ListBox Items="{Binding}" Width="250" Height="350"></ListBox>
+      <StackPanel Orientation="Vertical" Spacing="8">
+        <ListBox x:Name="listBox" Items="{Binding Items}" Width="250" Height="350" SelectionMode="{Binding SelectionMode}"></ListBox>
+
+        <Button Command="{Binding AddItemCommand}">Add</Button>
+
+        <Button Command="{Binding RemoveItemCommand}">Remove</Button>
+
+        <ComboBox SelectedIndex="{Binding SelectionMode, Mode=TwoWay}">
+          <ComboBoxItem>Single</ComboBoxItem>
+          <ComboBoxItem>Multiple</ComboBoxItem>
+          <ComboBoxItem>Toggle</ComboBoxItem>
+          <ComboBoxItem>AlwaysSelected</ComboBoxItem>
+        </ComboBox>
+      </StackPanel>
     </StackPanel>
   </StackPanel>
 </UserControl>