maui-linux/Xamarin.Forms.Platform.WinRT/CaseConverter.cs

29 строки
604 B
C#
Исходник Обычный вид История

2016-03-22 23:02:25 +03:00
using System;
#if WINDOWS_UWP
namespace Xamarin.Forms.Platform.UWP
#else
namespace Xamarin.Forms.Platform.WinRT
#endif
{
public class CaseConverter : Windows.UI.Xaml.Data.IValueConverter
{
public bool ConvertToUpper { get; set; }
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value == null)
return null;
var v = (string)value;
return ConvertToUpper ? v.ToUpper() : v.ToLower();
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotSupportedException();
}
}
}