using System;
using System.Diagnostics.Contracts;
using Windows.UI.Xaml.Data;
namespace OwlCore.WinUI.Converters.Numerical
{
///
/// A converter that converts a given to an .
///
public class StringToIntConverter : IValueConverter
{
///
/// Converts a to an .
///
/// The to convert
/// The converted value.
[Pure]
public static int Convert(string value) => int.Parse(value);
///
public object Convert(object value, Type targetType, object parameter, string language)
{
return Convert((string)value);
}
///
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return (double)value;
}
}
}