Nexus6Studio

mikehouston.net

US dominating at The President's Cup

by mhouston 29. September 2007 11:16

Awesome tournament so far!!  Can't wait to watch the Sunday singles!
http://www.pgatour.com/tournaments/presidentscup/

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Golf | Misc

One Click - handling updates in your code is easy

by mhouston 25. September 2007 03:48

ApplicationDeployment.CurrentDeployment.UpdateAsync();
ApplicationDeployment.CurrentDeployment.UpdateCompleted +=
 new AsyncCompletedEventHandler(CurrentDeployment_UpdateCompleted);

Technorati Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

.NET

My Dog has the best life...

by mhouston 24. September 2007 21:50

IMG_0041 IMG_0042 IMG_0044 IMG_0045

I wish she'd pay the bills for a while!

Technorati Tags: ,

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc

Binding in XAML sux!

by mhouston 24. September 2007 17:34

It appears there is no ‘real’ implementation for formatting or any ‘expressions’ in the binding syntax for XAML.  What a POS!

In order to format dates when binding in XAML I had to…

Create a implementation of IValueConverter  :

    public class ShortDateFormatConverter : IValueConverter

    {

        /*point of interest here – targetType appears to always be string; no matter what the actual type bound to is---WTF?*/

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

        {

            DateTime dateToFormat;           

            if (DateTime.TryParse(value.ToString(), out dateToFormat))

            {

                /*this is just so I could pass in any of the ‘format’ methods*/

                return dateToFormat.GetType().InvokeMember(parameter.ToString(), System.Reflection.BindingFlags.InvokeMethod, null, dateToFormat,null).ToString();

            }

            else

            {

                return string.Empty;

            }

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

        {

            throw new NotSupportedException("Cannot convert back at this time - if you need this access the object's individual properties");

        }

    }

 

Import the namespace :

<Window x:Class="test.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:cvrt="clr-namespace:test"

    Title="testing" Height="300" Width="709">

 

Set up the Converter to be used in the markup (create window resource) :

  <Window.Resources>

    <cvrt:StringConverter x:Key="StringConverter" />

    <cvrt:ShortDateFormatConverter x:Key="ShortDateFormatConverter" />

  </Window.Resources

 

At this point, I’m finally finished putting all the crap in place to actually bind a property to a ui object and use the converter to format it :

    <TextBox Text="{Binding Path=DtTest, Converter={StaticResource ShortDateFormatConverter}, ConverterParameter=ToLongDateString}" />

<!—any of the ‘format’ methods on DateTime will work here, like ToShortDateString, etc. à

 

If there really isn’t a ‘built-in’ way to apply basic expressions when binding in the markup then DataBinding in XAML is completely useless…and a half-ass implementation at best! 

That’s my last rant on that for the day ;-P

Technorati Tags: , , ,

Currently rated 4.0 by 4 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

.NET

SilverlightShow - Silverlight Community Site

by mhouston 3. September 2007 06:39

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

, ,

.NET

Wow! 64 core proc

by mhouston 3. September 2007 05:39

 

A buddy just mentioned this to me...I think I'm in shock right now!  Check it out.

Tilera Corporation

Technorati Tags: , , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

, , , ,

Misc

Sign in
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent any of my associates' views in anyway.
“A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. He may as well concern himself with his shadow on the wall. Speak what you think now in hard words, and tomorrow say what tomorrow thinks in hard words again, though it contradict everything you say today. "Ah, so you shall be sure to be misunderstood." Is it so bad, then, to be misunderstood? Pythagoras was misunderstood, and Jesus and Socrates and Luther and Copernicus and Galileo and Newton, and every pure and wise spirit that ever took flesh. To be great is to be misunderstood.” - Ralph Waldo Emerson
© Copyright 2010 Nexus6Studio & Mike Houston