Between vs2010 and blend4,
All i am trying to do is bind a list (of T) to a listbox using WPF
Apparently i need to use a datatemplate.
Here is the one in the MSDN example
<DataTemplate DataType="{x:Type src:AuctionItem}"><Border BorderThickness="1" BorderBrush="Gray"
Padding="7" Name="border" Margin="3" Width="500"><Grid><Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition Width="20"/><ColumnDefinition Width="86"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions><Polygon Grid.Row="0" Grid.Column="0" Grid.RowSpan="4"
Fill="Yellow" Stroke="Black" StrokeThickness="1"
StrokeLineJoin="Round" Width="20" Height="20"
Stretch="Fill"
Points="9,2 11,7 17,7 12,10 14,15 9,12 4,15 6,10 1,7 7,7"
Visibility="Hidden" Name="star"/><TextBlock Grid.Row="0" Grid.Column="1" Margin="0,0,8,0"
Name="descriptionTitle"
Style="{StaticResource smallTitleStyle}">Description:</TextBlock><TextBlock Name="DescriptionDTDataType" Grid.Row="0" Grid.Column="2"
Text="{Binding Path=Description}"
Style="{StaticResource textStyleTextBlock}"/><TextBlock Grid.Row="1" Grid.Column="1" Margin="0,0,8,0"
Name="currentPriceTitle"
Style="{StaticResource smallTitleStyle}">Current Price:</TextBlock><StackPanel Grid.Row="1" Grid.Column="2" Orientation="Horizontal"><TextBlock Text="$" Style="{StaticResource textStyleTextBlock}"/><TextBlock Name="CurrentPriceDTDataType"
Text="{Binding Path=CurrentPrice}"
Style="{StaticResource textStyleTextBlock}"/></StackPanel></Grid></Border><DataTemplate.Triggers><DataTrigger Binding="{Binding Path=SpecialFeatures}"><DataTrigger.Value><src:SpecialFeatures>Color</src:SpecialFeatures></DataTrigger.Value><DataTrigger.Setters><Setter Property="BorderBrush" Value="DodgerBlue" TargetName="border" /><Setter Property="Foreground" Value="Navy" TargetName="descriptionTitle" /><Setter Property="Foreground" Value="Navy" TargetName="currentPriceTitle" /><Setter Property="BorderThickness" Value="3" TargetName="border" /><Setter Property="Padding" Value="5" TargetName="border" /></DataTrigger.Setters></DataTrigger><DataTrigger Binding="{Binding Path=SpecialFeatures}"><DataTrigger.Value><src:SpecialFeatures>Highlight</src:SpecialFeatures></DataTrigger.Value><Setter Property="BorderBrush" Value="Orange" TargetName="border" /><Setter Property="Foreground" Value="Navy" TargetName="descriptionTitle" /><Setter Property="Foreground" Value="Navy" TargetName="currentPriceTitle" /><Setter Property="Visibility" Value="Visible" TargetName="star" /><Setter Property="BorderThickness" Value="3" TargetName="border" /><Setter Property="Padding" Value="5" TargetName="border" /></DataTrigger></DataTemplate.Triggers></DataTemplate>
Thats great but how do i design my own data template?
I have not figured out how to design this is vs2010 or blend.
Am i expected to code this by hand?
I am a profesional programmer. I come from the vb.net windows forms world.
I am investigating moving to WPF. So i thought i'd try to create a simple form with a listbox on it. and bind that listbox to a List(ofT) indexable collection.
Such a simple idea has lead to very complicated implementations.
Thank you up front for any help.
P.S. Microsoft seriously lacks video tutorials. Not to mention the even more deficient organization of what videos they do have. The Adobe model for organizing and presenting video tutorials is what Microsoft needs. One website with all the videos indexed and accessible with only one log in required. Microsoft requires that you join the web-cast and sign in twice for each video not to mention a confirmation page and a company name. Sorry i'm just venting.
Jerry C