Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Is Everyone Writing Converters?

Closed Thread
 
Thread Tools Display Modes
Old 03-07-2007   #1 (permalink)
Shawn Wildermuth's Avatar
Shawn Wildermuth
Guest


 



Is Everyone Writing Converters?

I am writing some XAML where the data I am binding needs some formatting
(e.g. numbers, dates, etc.). If my rounds through the books and web are
correct, WPF expects me to write converters for simple formatting. Maybe
I've missed it, but is there a simple string converter in the framework?
I know I can write in in several lines of code, but that's true with much
of the .NET framework. A simple converter that allows me to specify a format
string as a ConverterParameter would be great, but to use it in Blend and
other tools, it has to be created early as GAC'd. To paraphrase a famous
singer, for converters, "GAC is Whack!"...

Anyone know of a good solution that doesn't require either I get someone
else's converter or write my own?

Thanks,

Shawn Wildermuth
Microsoft MVP (C#)
http://wildermuthconsulting.com
mailto:swildermuth@REMOVE_ALLCAPS_adoguy.com


Old 03-12-2007   #2 (permalink)
Pon's Avatar
Pon
Guest


 



Re: Is Everyone Writing Converters?

I'm afraid the answer is yes. IMHO, that's one of the main lacks in WPF.
Same thing if u have to make a simple calculation on your data before
presenting them.
I've heard about an undocumented API to do that deep inside the framework
but I don't know more...


"Shawn Wildermuth" <swildermuth@REMOVE_ALLCAPS_adoguy.com> wrote in message
news:4dbdaca44c6e8c92ea799c6956b@msnews.microsoft.com...
>I am writing some XAML where the data I am binding needs some formatting
>(e.g. numbers, dates, etc.). If my rounds through the books and web are
>correct, WPF expects me to write converters for simple formatting. Maybe
>I've missed it, but is there a simple string converter in the framework? I
>know I can write in in several lines of code, but that's true with much of
>the .NET framework. A simple converter that allows me to specify a format
>string as a ConverterParameter would be great, but to use it in Blend and
>other tools, it has to be created early as GAC'd. To paraphrase a famous
>singer, for converters, "GAC is Whack!"...
>
> Anyone know of a good solution that doesn't require either I get someone
> else's converter or write my own?
>
> Thanks,
>
> Shawn Wildermuth
> Microsoft MVP (C#)
> http://wildermuthconsulting.com
> mailto:swildermuth@REMOVE_ALLCAPS_adoguy.com
>
>



Old 03-23-2007   #3 (permalink)
WPCoder's Avatar
WPCoder
Guest


 



Re: Is Everyone Writing Converters?

It is true that you'll need to create converters for many things in WPF.

I wrote a simple generic one here:

http://www.wiredprairie.us/journal/2...atted_num.html

I don't understand why Microsoft didn't create a few for us to use as
standards.

But, why would you need to use anything in the GAC? You can easily reference
a non-GAC'd assembly in most cases and use the converter as is within XAML.

--Aaron
http://www.wiredprairie.us/journal


"Shawn Wildermuth" <swildermuth@REMOVE_ALLCAPS_adoguy.com> wrote in message
news:4dbdaca44c6e8c92ea799c6956b@msnews.microsoft.com...
>I am writing some XAML where the data I am binding needs some formatting
>(e.g. numbers, dates, etc.). If my rounds through the books and web are
>correct, WPF expects me to write converters for simple formatting. Maybe
>I've missed it, but is there a simple string converter in the framework? I
>know I can write in in several lines of code, but that's true with much of
>the .NET framework. A simple converter that allows me to specify a format
>string as a ConverterParameter would be great, but to use it in Blend and
>other tools, it has to be created early as GAC'd. To paraphrase a famous
>singer, for converters, "GAC is Whack!"...
>
> Anyone know of a good solution that doesn't require either I get someone
> else's converter or write my own?
>
> Thanks,
>
> Shawn Wildermuth
> Microsoft MVP (C#)
> http://wildermuthconsulting.com
> mailto:swildermuth@REMOVE_ALLCAPS_adoguy.com
>
>


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: PDF converters for Vista ray Vista General 6 11-23-2007 10:48 AM
Re: PDF converters for Vista Ken Blake, MVP Vista General 0 11-22-2007 01:42 PM
Re: PDF converters for Vista Mike Hall - MVP Vista General 0 11-21-2007 09:59 PM
Re: PDF converters for Vista ray Vista General 0 11-21-2007 09:42 PM
analog converters Joyce Vista music pictures video 1 09-10-2007 08:56 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50