... 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
# Saturday, March 21, 2009

I was doing some research on design patterns for delegates verses interfaces and one page tab in particular caused an all to familiar message.

image


Just from habit I started to make a mental note of all the tabs I had open as I figured IE was about to go completely belly up and I would lose everything. Much to my delight, however, a simple message popped up indicating that the tab was about to be restarted and all my other sessions were intact.

I know this is not new to Firefox users but I have stubbornly stuck with IE (through thick and thin) and this marks one of those truly helpfully things that they are ultimately embarrassed to not already have.

 

 

 

 

 

Saturday, March 21, 2009 9:01:09 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
IE
# Friday, March 20, 2009

I just realized that IE8 has been released. If like me you were put off by some of the earlier betas you can put your mind at ease. There has been a metric ton off discussion around how slow or how fast it may or may not be. In my anecdotal opinion, IE8 is comparable to the other browsers. Microsoft found it necessary, however, to release a video explaining why the stats and discussions about IE8 were not quite valid. We shall see I guess ;)

Microsoft&#39;s tests of page-loading speeds gave it the edge over Chrome and Firefox. But page-loading speed isn't everything

Technorati Tags:
Friday, March 20, 2009 1:02:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback

# Thursday, March 19, 2009

I just realized that IE8 has been released. If like me you were put off by some of the earlier betas you can put your mind at ease. There has been a metric ton off discussion around how slow or how fast it may or may not be. In my anecdotal opinion, IE8 is comparable to the other browsers. Microsoft found it necessary, however, to release a video explaining why the stats and discussions about IE8 were not quite valid. We shall see I guess ;)

Technorati tags:

Thursday, March 19, 2009 7:22:25 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
IE
# Thursday, March 12, 2009

I was investigating and en error recently with DateTime.ToString() that gave produced the following call stack:

System.FormatException: Input string was not in a correct format.

at System.DateTimeFormat.GetRealFormat(String format, DateTimeFormatInfo dtfi)

at System.DateTimeFormat.ExpandPredefinedFormat(String format, DateTime& dateTime, DateTimeFormatInfo& dtfi)

at System.DateTimeFormat.Format(DateTime dateTime, String format, DateTimeFormatInfo dtfi)

at System.DateTime.ToString(String format, IFormatProvider provider)

at MyWork.NewMethod(string a, string b)

I was doing the following…

DateTime.ToString(“o”)

…which is a valid input string for 2.0 and above but not 1.1. This would not have been issue but the test PC I ran the offending assembly on had both 1.1 and 2.0. The ToString() method took the path of least resistance and used the framework dependencies under 2.0 and not 1.1. Of course the real problem arises when you try to rerun the assembly on a machine that only has .NET 1.1, at this point the “o” option is invalid.

 

Took me a few moments to track down, and reminded me never to trust MSDN (defaults to .NET 3.x) without verifying the backward compatibility of the options.

 

 

Thursday, March 12, 2009 5:16:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
.NET | C#
# Wednesday, February 25, 2009

I was getting the following error when trying to run visual studio 2003 project…

clip_image002

…this can be resolved as follows:

1. In the Internet Explorer, select the "Tools" Menu, then select "Internet Options".
2. Select the "Security" Tab in the new window.
3. Select the "Internet" globe icon.
4. Click the "Custom Level..." button at the bottom.
5. Locate the "User Authentication" section (it is at the bottom in IE7).
6. Select "Automatic logon with current username and password".
7. Click "Ok" twice to complete.

Technorati tags:
Wednesday, February 25, 2009 9:41:57 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Visual Studio
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)