|
80 | 80 | <ColumnDefinition Width="*" />
|
81 | 81 | <ColumnDefinition Width="*" />
|
82 | 82 | </Grid.ColumnDefinitions>
|
| 83 | + <Grid.RowDefinitions> |
| 84 | + <RowDefinition Height="*" /> |
| 85 | + <RowDefinition Height="Auto" /> |
| 86 | + </Grid.RowDefinitions> |
| 87 | + |
83 | 88 | <ListBox x:Name="LeftUnboundListBox"
|
| 89 | + Grid.Row="0" |
84 | 90 | Grid.Column="0"
|
85 | 91 | dd:DragDrop.IsDragSource="True"
|
86 | 92 | dd:DragDrop.IsDropTarget="True"
|
|
91 | 97 | <ListBoxItem>Unbound Item4</ListBoxItem>
|
92 | 98 | <ListBoxItem>Unbound Item5</ListBoxItem>
|
93 | 99 | </ListBox>
|
94 |
| - <ListBox Grid.Column="1" |
| 100 | + <ListBox x:Name="RightUnboundListBox" |
| 101 | + Grid.Row="0" |
| 102 | + Grid.Column="1" |
95 | 103 | dd:DragDrop.IsDragSource="True"
|
96 | 104 | dd:DragDrop.IsDropTarget="True">
|
97 | 105 | <ListBoxItem>Unbound Item6</ListBoxItem>
|
|
100 | 108 | <ListBoxItem>Unbound Item9</ListBoxItem>
|
101 | 109 | <ListBoxItem>Unbound Item10</ListBoxItem>
|
102 | 110 | </ListBox>
|
103 |
| - </Grid> |
104 | 111 |
|
105 |
| - <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="Customization (for left ListBox)" /> |
106 |
| - <CheckBox Margin="10 5" |
107 |
| - Content="IsDragSource" |
108 |
| - IsChecked="{Binding ElementName=LeftUnboundListBox, Path=(dd:DragDrop.IsDragSource), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
109 |
| - <CheckBox Margin="10 5" |
110 |
| - Content="IsDropTarget" |
111 |
| - IsChecked="{Binding ElementName=LeftUnboundListBox, Path=(dd:DragDrop.IsDropTarget), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
112 |
| - <CheckBox Margin="10 5" |
113 |
| - Content="UseDefaultDragAdorner" |
114 |
| - IsChecked="{Binding ElementName=LeftUnboundListBox, Path=(dd:DragDrop.UseDefaultDragAdorner), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
115 |
| - <CheckBox Margin="10 5" |
116 |
| - Content="UseDefaultEffectDataTemplate" |
117 |
| - IsChecked="{Binding ElementName=LeftUnboundListBox, Path=(dd:DragDrop.UseDefaultEffectDataTemplate), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
| 112 | + <views:SettingsView Grid.Row="1" |
| 113 | + Grid.Column="0" |
| 114 | + Caption="Customization (for left ListBox)" |
| 115 | + DataContext="{x:Reference LeftUnboundListBox}" /> |
| 116 | + <views:SettingsView Grid.Row="1" |
| 117 | + Grid.Column="1" |
| 118 | + Caption="Customization (for right ListBox)" |
| 119 | + DataContext="{x:Reference RightUnboundListBox}" /> |
| 120 | + </Grid> |
118 | 121 | </StackPanel>
|
119 | 122 | </ScrollViewer>
|
120 | 123 | </DockPanel>
|
|
294 | 297 | <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
295 | 298 | <StackPanel>
|
296 | 299 | <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="Demonstrates the behaviour with a ListBox which is bound to a grouped collection (CollectionViewSource). The ListBox uses also a custom DropHandler to handle the drop action." />
|
297 |
| - <ListBox x:Name="GroupedListBox" |
298 |
| - dd:DragDrop.DragDirectlySelectedOnly="True" |
299 |
| - dd:DragDrop.DropHandler="{Binding Data.GroupedDropHandler}" |
300 |
| - dd:DragDrop.IsDragSource="True" |
301 |
| - dd:DragDrop.IsDropTarget="True" |
302 |
| - DisplayMemberPath="Caption" |
303 |
| - ItemsSource="{Binding Source={StaticResource GroupedCollectionViewSource}}" |
304 |
| - SelectionMode="Extended"> |
305 |
| - <ListBox.GroupStyle> |
306 |
| - <x:Static Member="GroupStyle.Default" /> |
307 |
| - </ListBox.GroupStyle> |
308 |
| - </ListBox> |
| 300 | + <Grid> |
| 301 | + <Grid.RowDefinitions> |
| 302 | + <RowDefinition Height="*" /> |
| 303 | + <RowDefinition Height="Auto" /> |
| 304 | + </Grid.RowDefinitions> |
| 305 | + <ListBox x:Name="GroupedListBox" |
| 306 | + Grid.Row="0" |
| 307 | + dd:DragDrop.DragDirectlySelectedOnly="True" |
| 308 | + dd:DragDrop.DropHandler="{Binding Data.GroupedDropHandler}" |
| 309 | + dd:DragDrop.IsDragSource="True" |
| 310 | + dd:DragDrop.IsDropTarget="True" |
| 311 | + DisplayMemberPath="Caption" |
| 312 | + ItemsSource="{Binding Source={StaticResource GroupedCollectionViewSource}}" |
| 313 | + SelectionMode="Extended"> |
| 314 | + <ListBox.GroupStyle> |
| 315 | + <x:Static Member="GroupStyle.Default" /> |
| 316 | + </ListBox.GroupStyle> |
| 317 | + </ListBox> |
309 | 318 |
|
310 |
| - <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="Customization" /> |
311 |
| - <CheckBox Margin="10 5" |
312 |
| - Content="IsDragSource" |
313 |
| - IsChecked="{Binding ElementName=GroupedListBox, Path=(dd:DragDrop.IsDragSource), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
314 |
| - <CheckBox Margin="10 5" |
315 |
| - Content="IsDropTarget" |
316 |
| - IsChecked="{Binding ElementName=GroupedListBox, Path=(dd:DragDrop.IsDropTarget), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
317 |
| - <CheckBox Margin="10 5" |
318 |
| - Content="UseDefaultDragAdorner" |
319 |
| - IsChecked="{Binding ElementName=GroupedListBox, Path=(dd:DragDrop.UseDefaultDragAdorner), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
320 |
| - <CheckBox Margin="10 5" |
321 |
| - Content="UseDefaultEffectDataTemplate" |
322 |
| - IsChecked="{Binding ElementName=GroupedListBox, Path=(dd:DragDrop.UseDefaultEffectDataTemplate), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
| 319 | + <views:SettingsView Grid.Row="1" |
| 320 | + Caption="Customization" |
| 321 | + DataContext="{x:Reference GroupedListBox}" /> |
| 322 | + </Grid> |
323 | 323 | </StackPanel>
|
324 | 324 | </ScrollViewer>
|
325 | 325 | </DockPanel>
|
326 | 326 | </TabItem>
|
327 | 327 |
|
328 | 328 | <TabItem Header="DragDropKeyStates">
|
329 |
| - <TabItem.Resources> |
330 |
| - <ObjectDataProvider x:Key="DragDropKeyStatesEnumValues" |
331 |
| - MethodName="GetValues" |
332 |
| - ObjectType="{x:Type DragDropKeyStates}"> |
333 |
| - <ObjectDataProvider.MethodParameters> |
334 |
| - <x:Type TypeName="DragDropKeyStates" /> |
335 |
| - </ObjectDataProvider.MethodParameters> |
336 |
| - </ObjectDataProvider> |
337 |
| - </TabItem.Resources> |
338 | 329 | <DockPanel LastChildFill="True">
|
339 | 330 | <TextBlock DockPanel.Dock="Top"
|
340 | 331 | Style="{StaticResource SampleHeaderTextBlockStyle}"
|
|
347 | 338 | <ColumnDefinition Width="*" />
|
348 | 339 | <ColumnDefinition Width="*" />
|
349 | 340 | </Grid.ColumnDefinitions>
|
| 341 | + <Grid.RowDefinitions> |
| 342 | + <RowDefinition Height="*" /> |
| 343 | + <RowDefinition Height="Auto" /> |
| 344 | + </Grid.RowDefinitions> |
| 345 | + |
350 | 346 | <ListBox x:Name="LeftListBoxOfDragDropKeyStatesSample"
|
| 347 | + Grid.Row="0" |
351 | 348 | Grid.Column="0"
|
352 | 349 | dd:DragDrop.DragDropCopyKeyState="ControlKey"
|
353 | 350 | dd:DragDrop.IsDragSource="True"
|
354 | 351 | dd:DragDrop.IsDropTarget="True"
|
355 | 352 | dd:DragDrop.UseDefaultEffectDataTemplate="True"
|
356 | 353 | ItemsSource="{Binding Data.Collection1}" />
|
357 |
| - <ListBox Grid.Column="1" |
| 354 | + <ListBox x:Name="RightListBoxOfDragDropKeyStatesSample" |
| 355 | + Grid.Row="0" |
| 356 | + Grid.Column="1" |
358 | 357 | dd:DragDrop.IsDragSource="True"
|
359 | 358 | dd:DragDrop.IsDropTarget="True"
|
360 | 359 | ItemsSource="{Binding Data.Collection2}" />
|
361 |
| - </Grid> |
362 | 360 |
|
363 |
| - <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="Customization (for left ListBox)" /> |
364 |
| - <StackPanel Margin="10 5" Orientation="Horizontal"> |
365 |
| - <TextBlock VerticalAlignment="Center" Text="DragDropCopyKeyState" /> |
366 |
| - <ComboBox Width="200" |
367 |
| - Margin="5 0 0 0" |
368 |
| - VerticalAlignment="Center" |
369 |
| - ItemsSource="{Binding Source={StaticResource DragDropKeyStatesEnumValues}}" |
370 |
| - SelectedItem="{Binding ElementName=LeftListBoxOfDragDropKeyStatesSample, Path=(dd:DragDrop.DragDropCopyKeyState), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
371 |
| - </StackPanel> |
372 |
| - <CheckBox Margin="10 5" |
373 |
| - Content="IsDragSource" |
374 |
| - IsChecked="{Binding ElementName=LeftListBoxOfDragDropKeyStatesSample, Path=(dd:DragDrop.IsDragSource), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
375 |
| - <CheckBox Margin="10 5" |
376 |
| - Content="IsDropTarget" |
377 |
| - IsChecked="{Binding ElementName=LeftListBoxOfDragDropKeyStatesSample, Path=(dd:DragDrop.IsDropTarget), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
378 |
| - <CheckBox Margin="10 5" |
379 |
| - Content="UseDefaultDragAdorner" |
380 |
| - IsChecked="{Binding ElementName=LeftListBoxOfDragDropKeyStatesSample, Path=(dd:DragDrop.UseDefaultDragAdorner), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
381 |
| - <CheckBox Margin="10 5" |
382 |
| - Content="UseDefaultEffectDataTemplate" |
383 |
| - IsChecked="{Binding ElementName=LeftListBoxOfDragDropKeyStatesSample, Path=(dd:DragDrop.UseDefaultEffectDataTemplate), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
| 361 | + <views:SettingsView Grid.Row="1" |
| 362 | + Grid.Column="0" |
| 363 | + Caption="Customization (for left ListBox)" |
| 364 | + DataContext="{x:Reference LeftListBoxOfDragDropKeyStatesSample}" |
| 365 | + ShowCopyKeyState="True" /> |
| 366 | + <views:SettingsView Grid.Row="1" |
| 367 | + Grid.Column="1" |
| 368 | + Caption="Customization (for right ListBox)" |
| 369 | + DataContext="{x:Reference RightListBoxOfDragDropKeyStatesSample}" |
| 370 | + ShowCopyKeyState="True" /> |
| 371 | + </Grid> |
384 | 372 | </StackPanel>
|
385 | 373 | </ScrollViewer>
|
386 | 374 | </DockPanel>
|
|
0 commit comments