master
cs 22 lines 739 Bytes
Raw
1 // Copyright (C) Microsoft Corporation. All rights reserved.
2
3 namespace WslSettings.Converters
4 {
5 public sealed class MillisecondsStringConverter : Microsoft.UI.Xaml.Data.IValueConverter
6 {
7 public object? Convert(object value, Type targetType, object parameter, string language)
8 {
9 if (value == null || (value is ulong && (ulong)value == 0))
10 {
11 return null;
12 }
13
14 return string.Format("Settings_MillisecondsStringFormat".GetLocalized(), value);
15 }
16
17 public object ConvertBack(object value, Type targetType, object parameter, string language)
18 {
19 throw new NotImplementedException();
20 }
21 }
22 }