Skip to content

Commit

Permalink
Example for PR #73
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Sep 25, 2013
1 parent d051d74 commit 895013f
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Examples/DefaultsExample/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public Data()
{
this.Collection1 = new ObservableCollection<string>();
this.Collection2 = new ObservableCollection<string>();
this.Collection3 = new ObservableCollection<string>();
this.CustomCollection1 = new ObservableCollection<CustomDataModel>();
this.CustomCollection2 = new ObservableCollection<CustomDataModel>();

Expand Down Expand Up @@ -51,6 +52,7 @@ public Data()

public ObservableCollection<string> Collection1 { get; private set; }
public ObservableCollection<string> Collection2 { get; private set; }
public ObservableCollection<string> Collection3 { get; private set; }
public ObservableCollection<CustomDataModel> CustomCollection1 { get; private set; }
public ObservableCollection<CustomDataModel> CustomCollection2 { get; private set; }
public ObservableCollection<GroupedItem> GroupedCollection { get; private set; }
Expand Down
66 changes: 66 additions & 0 deletions Examples/DefaultsExample/Window(NET4).xaml
Original file line number Diff line number Diff line change
Expand Up @@ -746,5 +746,71 @@
dd:DragDrop.IsDropTarget="True" />
</Grid>
</TabItem>

<TabItem Header="Empty ItemsControl">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>

<TextBlock Grid.Row="0"
Grid.ColumnSpan="2"
Margin="0,8,0,8"
TextWrapping="Wrap">
Example for PR #73: Crash on click inside ItemsControl where ItemsSource.Count == 0
</TextBlock>

<Grid Grid.Column="0"
Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ItemsControl Grid.Row="0"
Margin="0,0,0,2"
ItemsSource="{Binding Collection3}"
Background="Beige"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"
dd:DragDrop.DragAdornerTemplate="{StaticResource DragAdorner}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Label Content="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ListBox Grid.Row="1"
ItemsSource="{Binding Collection3}"
Background="Beige"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"
dd:DragDrop.DragAdornerTemplate="{StaticResource DragAdorner}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Label Content="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ListBox>
</Grid>

<ListBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Collection1}"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"
dd:DragDrop.DragAdornerTemplate="{StaticResource DragAdorner}">
<ListBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</TabItem>
</TabControl>
</Window>

0 comments on commit 895013f

Please sign in to comment.