|
<!--Copyright Nick Polyak 2008-->
<Window x:Class="DragDropTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DragDropTest"
Title="Simple WPF Drag Drop Test"
Height="300"
Width="300">
<Window.Resources>
<local:Shapes x:Key="MyShapes"/>
</Window.Resources>
<Grid>
<ListView Name="ListView1"
ItemsSource="{Binding Source={StaticResource MyShapes}}"
SelectionMode="Extended"
AllowDrop="True">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel AllowDrop="True" Orientation="Horizontal">
<TextBlock Text="Shape Name: "/>
<TextBlock Text="{Binding Path=Name}"/>
<TextBlock Text=". Number of Sides: "/>
<TextBlock Text="{Binding Path=NumSides}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</Grid>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a software architect and a developer with great passion for new engineering solutions and finding and applying design patterns.
I am passionate about learning new ways of building software and sharing my knowledge with others.
I worked with many various languages including C#, Java and C++.
I fell in love with WPF (and later Silverlight) at first sight. After Microsoft killed Silverlight, I was distraught until I found Avalonia - a great multiplatform package for building UI on Windows, Linux, Mac as well as within browsers (using WASM) and for mobile platforms.
I have my Ph.D. from RPI.
here is my linkedin profile