2020-02-15 00:10:58 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Bit.App.Utilities
|
|
|
|
|
{
|
|
|
|
|
public class UpperCaseConverter : IValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
2020-03-28 16:16:28 +03:00
|
|
|
|
if (targetType != typeof(string))
|
2020-02-15 00:10:58 +03:00
|
|
|
|
{
|
|
|
|
|
throw new InvalidOperationException("The target must be a string.");
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-28 16:16:28 +03:00
|
|
|
|
if (value == null)
|
2020-02-15 00:10:58 +03:00
|
|
|
|
{
|
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return parameter.ToString().ToUpper();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
throw new NotSupportedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|