Lottie-Windows/LottieViewer/FloatFormatter.cs

26 строки
765 B
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using System;
using Windows.UI.Xaml.Data;
namespace LottieViewer
{
public sealed class FloatFormatter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
{
return ((double)value).ToString("0.#");
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
{
// Only support one way binding.
throw new NotImplementedException();
}
}
}