Quantcast
Channel: Datatemplate WYSIWYG?
Viewing all articles
Browse latest Browse all 3

Datatemplate WYSIWYG?

$
0
0

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


Viewing all articles
Browse latest Browse all 3

Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Trending Articles


Break up Quotes Tagalog Love Quote – Broken Hearted Quotes Tagalog


FORECLOSURE OF REAL ESTATE MORTGAGE


Winx Club para colorear


Girasoles para colorear


Dibujos para colorear de perros


Toro para colorear


Lagarto para colorear


Long Distance Relationship Tagalog Love Quotes


Tropa Quotes


Mga Tala sa “Unang Siglo ng Nobela sa Filipinas” (2009) ni Virgilio S. Almario


Ang Nobela sa “From Darna to ZsaZsa Zaturnnah: Desire and Fantasy, Essays on...


Gwapo Quotes : Babaero Quotes


Libros para colorear


Mandalas de flores para colorear


Renos para colorear


Dromedario para colorear


mayabang Quotes, Torpe Quotes, tanga Quotes


Love Quotes Tagalog


RE: Mutton Pies (mely)


El Vibora (1971) by Francisco V. Coching and Federico C. Javinal





Latest Images

Pangarap Quotes

Pangarap Quotes

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC