Migrate aurora-sharp-desktop
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Aurora.Design.Converters
|
||||
{
|
||||
public class DoubleToLayoutOptionsConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var result = double.TryParse(value.ToString(), out double val);
|
||||
if (result && val > 0)
|
||||
{
|
||||
return LayoutOptions.CenterAndExpand;
|
||||
}
|
||||
return LayoutOptions.FillAndExpand;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user