2016-08-30 20:46:14 +03:00
|
|
|
using System;
|
2016-03-22 23:02:25 +03:00
|
|
|
using Xamarin.Forms.Platform;
|
|
|
|
|
|
|
|
namespace Xamarin.Forms
|
|
|
|
{
|
|
|
|
[RenderWith(typeof(_TabbedPageRenderer))]
|
2018-08-31 21:35:56 +03:00
|
|
|
public class TabbedPage : MultiPage<Page>, IBarElement, IElementConfiguration<TabbedPage>
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
2018-08-31 21:35:56 +03:00
|
|
|
public static readonly BindableProperty BarBackgroundColorProperty = BarElement.BarBackgroundColorProperty;
|
2016-04-18 19:46:51 +03:00
|
|
|
|
2020-07-17 17:44:13 +03:00
|
|
|
public static readonly BindableProperty BarBackgroundProperty = BarElement.BarBackgroundProperty;
|
|
|
|
|
2018-08-31 21:35:56 +03:00
|
|
|
public static readonly BindableProperty BarTextColorProperty = BarElement.BarTextColorProperty;
|
2016-04-18 19:46:51 +03:00
|
|
|
|
2019-03-02 02:47:31 +03:00
|
|
|
public static readonly BindableProperty UnselectedTabColorProperty = BindableProperty.Create(nameof(UnselectedTabColor), typeof(Color), typeof(TabbedPage), default(Color));
|
|
|
|
|
|
|
|
public static readonly BindableProperty SelectedTabColorProperty = BindableProperty.Create(nameof(SelectedTabColor), typeof(Color), typeof(TabbedPage), default(Color));
|
|
|
|
|
2016-08-30 20:46:14 +03:00
|
|
|
readonly Lazy<PlatformConfigurationRegistry<TabbedPage>> _platformConfigurationRegistry;
|
|
|
|
|
2018-08-31 21:35:56 +03:00
|
|
|
public Color BarBackgroundColor {
|
|
|
|
get => (Color)GetValue(BarElement.BarBackgroundColorProperty);
|
|
|
|
set => SetValue(BarElement.BarBackgroundColorProperty, value);
|
2016-04-18 19:46:51 +03:00
|
|
|
}
|
|
|
|
|
2020-07-17 17:44:13 +03:00
|
|
|
public Brush BarBackground
|
|
|
|
{
|
|
|
|
get => (Brush)GetValue(BarElement.BarBackgroundProperty);
|
|
|
|
set => SetValue(BarElement.BarBackgroundProperty, value);
|
|
|
|
}
|
|
|
|
|
2018-08-31 21:35:56 +03:00
|
|
|
public Color BarTextColor {
|
|
|
|
get => (Color)GetValue(BarElement.BarTextColorProperty);
|
|
|
|
set => SetValue(BarElement.BarTextColorProperty, value);
|
2016-04-18 19:46:51 +03:00
|
|
|
}
|
|
|
|
|
2019-03-02 02:47:31 +03:00
|
|
|
public Color UnselectedTabColor
|
|
|
|
{
|
|
|
|
get => (Color)GetValue(UnselectedTabColorProperty);
|
|
|
|
set => SetValue(UnselectedTabColorProperty, value);
|
|
|
|
}
|
|
|
|
public Color SelectedTabColor
|
|
|
|
{
|
|
|
|
get => (Color)GetValue(SelectedTabColorProperty);
|
|
|
|
set => SetValue(SelectedTabColorProperty, value);
|
|
|
|
}
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
protected override Page CreateDefault(object item)
|
|
|
|
{
|
|
|
|
var page = new Page();
|
|
|
|
if (item != null)
|
|
|
|
page.Title = item.ToString();
|
|
|
|
|
|
|
|
return page;
|
|
|
|
}
|
2016-08-30 20:46:14 +03:00
|
|
|
|
|
|
|
public TabbedPage()
|
|
|
|
{
|
|
|
|
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<TabbedPage>>(() => new PlatformConfigurationRegistry<TabbedPage>(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
public new IPlatformElementConfiguration<T, TabbedPage> On<T>() where T : IConfigPlatform
|
|
|
|
{
|
|
|
|
return _platformConfigurationRegistry.Value.On<T>();
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
}
|
|
|
|
}
|