... all I'm offering is the truth. Nothing more. RSS 2.0
# Friday, March 27, 2009

I have just completed 10 day attack on Windows Presentation Foundation and after repeated false starts I have concluded I need to buy a book. In the age of Google search this may seem absurd to the average developer, however, after 8 days of trying to recreate a Windows Forms App (the other 2 days were actually useful) I am realizing I need to have a paradigm shift in my current mindset. Let us take the humble ListBox for example, the XAML would look something like this:

image        <ListBox>
            <ListBoxItem>Item 1</ListBoxItem>
            <ListBoxItem>Item 2</ListBoxItem>
            <ListBoxItem>Item 3</ListBoxItem>
            <ListBoxItem>Item 4</ListBoxItem>
        </ListBox>


So I thought that was it I *know* List Boxes in WPF … WRONG! This is not even scratching the surface my friends! Our capable WPF designers have broken the ListBox into its simplest forms. For example let us trying creating a list of Rectangles

image        <ListBox>
            <Rectangle Width="20" Height="20" Stroke="Yellow"  StrokeThickness="4" ></Rectangle>
            <Rectangle Width="20" Height="20" Stroke="Blue"  StrokeThickness="4" ></Rectangle>
            <Rectangle Width="20" Height="20" Stroke="Green"  StrokeThickness="4" ></Rectangle>
        </ListBox>

 

or ellipses…

image

        <ListBox>
            <Ellipse Width="20" Height="20" Stroke="Yellow"  StrokeThickness="4" ></Ellipse>
            <Ellipse Width="20" Height="20" Stroke="Blue"  StrokeThickness="4" ></Ellipse>
            <Ellipse Width="20" Height="20" Stroke="Green"  StrokeThickness="4" ></Ellipse>
        </ListBox>

 

…or any combination of the above. It is a type agnostic list of items you want to show. I can also orient the flow of list boxes as I see fit…

image

        <ListBox VerticalAlignment="Top">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal" IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <Ellipse Width="20" Height="20" Stroke="Yellow"  StrokeThickness="4" ></Ellipse>
            <Ellipse Width="20" Height="20" Stroke="Blue"  StrokeThickness="4" ></Ellipse>
            <Ellipse Width="20" Height="20" Stroke="Green"  StrokeThickness="4" ></Ellipse>
        </ListBox>


Can you see why I need a book, at a casual glance I thought I really knew what was going on with a simple drag and drop, but on closer inspection it is clear that I am missing some underlying goodness through my own poor ignorance.

WPF rocks!!!

Technorati Tags: ,
Friday, March 27, 2009 12:09:28 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1] - Trackback
.NET | WPF
Monday, May 18, 2009 10:58:37 AM (Eastern Daylight Time, UTC-04:00)
Greeting. Turn the world over on its side and everything loose will land in Los Angeles. Help me! Need information about: drug and alcohol rehab treatment. I found only this - photo shop uroki. Alcohol treatment for teenagers should be age appropriate and it should involve other family members as well. recovery program for drug and alcohol abuse. Thanks for the help :cool:, Pierre from Italy.
Comments are closed.
Blogroll
Statistics
Total Posts: 330
This Year: 18
This Month: 2
This Week: 0
Comments: 30
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Mark Downie
Sign In
All Content © 2010, Mark Downie
DasBlog theme 'Business' created by Christoph De Baene (delarou)