1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
5 namespace System.Activities.Presentation
7 using System.Activities.Presentation.Model;
8 using System.Globalization;
9 using System.Windows.Data;
10 using Microsoft.Activities.Presentation;
12 internal sealed class TypeNameConverter : IValueConverter
14 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 Type type = value as Type;
20 ModelItem modelItem = value as ModelItem;
21 if (modelItem != null)
23 type = modelItem.GetCurrentValue() as Type;
27 bool fullName = bool.Parse(parameter.ToString());
29 return TypeNameHelper.GetDisplayName(type, fullName);
32 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
34 throw FxTrace.Exception.AsError(new NotImplementedException());