1234567891011121314151617181920212223 |
- using System;
- using System.Globalization;
- using Xamarin.Forms;
- namespace InABox.Mobile
- {
- public class FormatConverter : IValueConverter
- {
- public String Format { get; set; }
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return String.IsNullOrWhiteSpace(Format)
- ? value
- : String.Format($"{{0:{Format}}}", value);
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|