This is a migrated thread and some comments may be shown as answers.

Telerik Sales Dashboard Demo, CountryToSymbolConverter

0 Answers 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wan
Top achievements
Rank 1
Wan asked on 22 Feb 2012, 10:48 AM

I was found a class "CountryToSymbolConverter" in this demo

using System;
using System.Globalization;
using System.Windows.Data;
 
namespace SalesDashboard_SL
{
    public class CountryToSymbolConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            switch (value.ToString())
            {
                case "Germany": return 'f';
                case "United States": return 'U';
                case "Canada": return 'c';
                case "United Kingdom": return '*';
                case "Australia": return 's';
                case "France": return 'w';
            }
            return ((DateTime)value).AddDays(1);
        }
 
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}

Please tell me more "county code" about this class,thanks.


Tags
General Discussions
Asked by
Wan
Top achievements
Rank 1
Share this question
or