|
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.Activities.Presentation
{
using System.Diagnostics;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Activities.Presentation.Model;
//Formats text strings
internal sealed class TextFormattingConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (parameter is string)
{
return string.Format(culture, parameter as string, value);
}
else
{
return value.ToString();
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw FxTrace.Exception.AsError(new NotSupportedException());
}
}
}
|