Here is my problem: I have a XElement storing a DateTime, and I want to get the Value property returning the DateTime in a custom format.
Scenario I can\'t seem to find a way to format bindings in WPF using an IFormatProvider. Currently I\'ve a property on my data source:
This seems like a simple exercise, but I\'ll be darned if I can find an example of doing it right in MSDN or anywhere on the web.
The IFormatProvider interface allows me to create a class which does custom formatting of objects as strings and can be used with e.g. string.Format.
In a WinGrid (Infragistics, if you must know) I got a column containing ints. The value is a number of seconds, from which you can calculate a time. I created an IFormatProvider/ICustomFormatter that
I have an Integer value in my object. I need to cast it as an integer value. So I have do开发者_Go百科ne it this way.
I need to display a currency in my ASP.NET MVC application but when the currency is 0 I would like it to display \"Free\" (localized of course!) instead of开发者_运维百科 $0.00.
So, maybe this is a bad design; I don\'t know. But say I have a DataTable with a column that holds int values; these values are in fact meant to represent some enum type that I have in my project.
I have a label that i want to show it\'s Text(\"1234567\") Like A Number With Th开发者_运维百科ousand Separator//
I was trying to create an IFormatProvider implementation that would recognize custom format strings for DateTime objects. Here is my implementation: