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(_ActivityIndicatorRenderer))]
|
2016-08-30 20:46:14 +03:00
|
|
|
public class ActivityIndicator : View, IElementConfiguration<ActivityIndicator>
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
|
|
|
public static readonly BindableProperty IsRunningProperty = BindableProperty.Create("IsRunning", typeof(bool), typeof(ActivityIndicator), default(bool));
|
|
|
|
|
|
|
|
public static readonly BindableProperty ColorProperty = BindableProperty.Create("Color", typeof(Color), typeof(ActivityIndicator), Color.Default);
|
|
|
|
|
2016-08-30 20:46:14 +03:00
|
|
|
readonly Lazy<PlatformConfigurationRegistry<ActivityIndicator>> _platformConfigurationRegistry;
|
|
|
|
|
|
|
|
public ActivityIndicator()
|
|
|
|
{
|
|
|
|
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<ActivityIndicator>>(() => new PlatformConfigurationRegistry<ActivityIndicator>(this));
|
|
|
|
}
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
public Color Color
|
|
|
|
{
|
|
|
|
get { return (Color)GetValue(ColorProperty); }
|
|
|
|
set { SetValue(ColorProperty, value); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsRunning
|
|
|
|
{
|
|
|
|
get { return (bool)GetValue(IsRunningProperty); }
|
|
|
|
set { SetValue(IsRunningProperty, value); }
|
|
|
|
}
|
2016-08-30 20:46:14 +03:00
|
|
|
public IPlatformElementConfiguration<T, ActivityIndicator> On<T>() where T : IConfigPlatform
|
|
|
|
{
|
|
|
|
return _platformConfigurationRegistry.Value.On<T>();
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
}
|
|
|
|
}
|