|
175 | 175 | </Grid> |
176 | 176 | </smtx:XamlDisplay> |
177 | 177 |
|
178 | | - <TextBlock Style="{StaticResource MaterialDesignHeadline6TextBlock}" Text="Multi-Select Tree View:" |
179 | | - Grid.Column="2"/> |
| 178 | + <TextBlock Grid.Column="2" |
| 179 | + Style="{StaticResource MaterialDesignHeadline6TextBlock}" |
| 180 | + Text="Multi-Select Tree View:" /> |
180 | 181 | <smtx:XamlDisplay Grid.Row="1" |
181 | 182 | Grid.Column="2" |
182 | 183 | VerticalContentAlignment="Top" |
183 | 184 | UniqueKey="trees_3"> |
184 | | - <Grid> |
185 | | - <materialDesign:TreeListView MinWidth="220" MaxHeight="450" |
186 | | - ItemsSource="{Binding TreeItems}" |
187 | | - SelectedItem="{Binding SelectedTreeItem}"> |
188 | | - <materialDesign:TreeListView.ItemTemplate> |
189 | | - <HierarchicalDataTemplate DataType="{x:Type domain:TestItem}" |
190 | | - ItemsSource="{Binding Items, Mode=OneWay}"> |
191 | | - <TextBlock Margin="3,2" Text="{Binding Name, Mode=OneWay}" /> |
192 | | - </HierarchicalDataTemplate> |
193 | | - </materialDesign:TreeListView.ItemTemplate> |
| 185 | + <StackPanel Orientation="Horizontal"> |
| 186 | + <Grid> |
| 187 | + <materialDesign:TreeListView MinWidth="220" |
| 188 | + MaxHeight="450" |
| 189 | + ItemsSource="{Binding TreeItems}" |
| 190 | + SelectedItem="{Binding SelectedTreeItem}" |
| 191 | + SelectedItems="{Binding SelectedTreeItems}"> |
| 192 | + <materialDesign:TreeListView.ItemTemplate> |
| 193 | + <HierarchicalDataTemplate DataType="{x:Type domain:TestItem}" ItemsSource="{Binding Items, Mode=OneWay}"> |
| 194 | + <TextBlock Margin="3,2" Text="{Binding Name, Mode=OneWay}" /> |
| 195 | + </HierarchicalDataTemplate> |
| 196 | + </materialDesign:TreeListView.ItemTemplate> |
| 197 | + |
| 198 | + </materialDesign:TreeListView> |
| 199 | + <StackPanel HorizontalAlignment="Right" |
| 200 | + VerticalAlignment="Bottom" |
| 201 | + Orientation="Horizontal"> |
| 202 | + <Button Command="{Binding AddListTreeItemCommand}" |
| 203 | + Content="{materialDesign:PackIcon Kind=Add}" |
| 204 | + ToolTip="Add an item" /> |
| 205 | + |
| 206 | + <Button Command="{Binding RemoveListTreeItemCommand}" |
| 207 | + Content="{materialDesign:PackIcon Kind=Remove}" |
| 208 | + ToolTip="Remove selected item(s)" /> |
194 | 209 |
|
195 | | - </materialDesign:TreeListView> |
196 | | - <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right"> |
197 | | - <Button Command="{Binding AddListTreeItemCommand}" |
198 | | - ToolTip="Add an item" |
199 | | - Content="{materialDesign:PackIcon Kind=Add}"/> |
| 210 | + </StackPanel> |
| 211 | + </Grid> |
| 212 | + |
| 213 | + <GroupBox Margin="4,0,0,0" Header="TreeListView.SelectedItems"> |
| 214 | + <ListBox HorizontalContentAlignment="Stretch" ItemsSource="{Binding SelectedTreeItems}"> |
| 215 | + <ListBox.ItemTemplate> |
| 216 | + <DataTemplate> |
| 217 | + <Grid> |
| 218 | + <Grid.ColumnDefinitions> |
| 219 | + <ColumnDefinition Width="*" /> |
| 220 | + <ColumnDefinition Width="auto" /> |
| 221 | + </Grid.ColumnDefinitions> |
| 222 | + <TextBlock Grid.Column="0" |
| 223 | + VerticalAlignment="Center" |
| 224 | + Text="{Binding Name}" /> |
| 225 | + <Button Grid.Column="1" |
| 226 | + Width="{Binding Path=ActualHeight, RelativeSource={RelativeSource Mode=Self}}" |
| 227 | + Padding="4" |
| 228 | + Command="{Binding DataContext.RemoveSelectedListTreeItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" |
| 229 | + CommandParameter="{Binding .}" |
| 230 | + Content="{materialDesign:PackIcon Kind=Bin}" |
| 231 | + Foreground="Red" |
| 232 | + Style="{StaticResource MaterialDesignFlatButton}" /> |
| 233 | + </Grid> |
| 234 | + </DataTemplate> |
| 235 | + </ListBox.ItemTemplate> |
| 236 | + </ListBox> |
| 237 | + </GroupBox> |
200 | 238 |
|
201 | | - <Button Command="{Binding RemoveListTreeItemCommand}" |
202 | | - ToolTip="Remove selected item(s)" |
203 | | - Content="{materialDesign:PackIcon Kind=Remove}"/> |
| 239 | + </StackPanel> |
204 | 240 |
|
205 | | - </StackPanel> |
206 | | - </Grid> |
207 | 241 | </smtx:XamlDisplay> |
208 | 242 |
|
209 | 243 | <TextBlock Grid.Row="2" |
|
0 commit comments