Added tab view (not working)

This commit is contained in:
watsonb8
2019-12-21 22:21:07 -05:00
parent 881d339ffd
commit 7560e122f8
10 changed files with 849 additions and 27 deletions

View File

@ -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;
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Globalization;
using Xamarin.Forms;
namespace Aurora.Design.Converters
{
public class NullToBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value != null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Globalization;
using Aurora.Design.Components.TabView;
using Xamarin.Forms;
namespace Aurora.Design.Converters
{
class SelectedTabHeaderToTabBackgroundColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool isCurrentTabSelected = false;
if (!string.IsNullOrWhiteSpace(value?.ToString()))
bool.TryParse(value.ToString(), out isCurrentTabSelected);
if (parameter is TabViewControl tvc && isCurrentTabSelected)
{
return tvc.HeaderSelectionUnderlineColor;
}
else
{
return Color.Transparent;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}