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))]
|
2016-08-30 20:46:14 +03:00
|
|
|
public class TabbedPage : MultiPage<Page>, IElementConfiguration<TabbedPage>
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
2016-04-18 19:46:51 +03:00
|
|
|
public static readonly BindableProperty BarBackgroundColorProperty = BindableProperty.Create(nameof(BarBackgroundColor), typeof(Color), typeof(TabbedPage), Color.Default);
|
|
|
|
|
|
|
|
public static readonly BindableProperty BarTextColorProperty = BindableProperty.Create(nameof(BarTextColor), typeof(Color), typeof(TabbedPage), Color.Default);
|
|
|
|
|
2016-08-30 20:46:14 +03:00
|
|
|
readonly Lazy<PlatformConfigurationRegistry<TabbedPage>> _platformConfigurationRegistry;
|
|
|
|
|
2016-04-18 19:46:51 +03:00
|
|
|
public Color BarBackgroundColor
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return (Color)GetValue(BarBackgroundColorProperty);
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
SetValue(BarBackgroundColorProperty, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Color BarTextColor
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return (Color)GetValue(BarTextColorProperty);
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
SetValue(BarTextColorProperty, 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
|
|
|
}
|
|
|
|
}
|