
If (sender is ActivityButton activityButton & newValue != null)Ī = newValue Private static void CommandParameterUpdated( object sender, object oldValue, object newValue) If (sender is ActivityButton activityButton & newValue is ICommand newCommand)Ī = newCommand Private static void CommandUpdated( object sender, object oldValue, object newValue)

If (sender is ActivityButton activityButton & newValue is string newString)Ī = newString Private static void TextUpdated( object sender, object oldValue, object newValue) Private void OnClicked( object sender, EventArgs args) Set => this.SetValue(TextColorProperty, value) Get => (Color) this.GetValue(TextColorProperty) Set => this.SetValue(BackgroundColorProperty, value) Get => (Color) this.GetValue(BackgroundColorProperty) Set => this.SetValue(CornerRadiusProperty, value) Get => ( int) this.GetValue(CornerRadiusProperty) Set => this.SetValue(IsBusyProperty, value) Get => ( bool) this.GetValue(IsBusyProperty) Set => this.SetValue(CommandParameterProperty, value) Get => this.GetValue(CommandParameterProperty) Set => this.SetValue(CommandProperty, value) Get => (ICommand) this.GetValue(CommandProperty) Set => this.SetValue(TextProperty, value) Get => ( string) this.GetValue(TextProperty) Public event EventHandler Clicked = delegate Public partial class ActivityButton : ContentView
PHOTODESK ACTIVIYT BUTTON CODE
Since we are using a ContentView to combine our two elements, we will have to add a little bit of boiler plate code to make our ActivityButton reusable. Public static new readonly BindableProperty BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(ActivityButton)) Public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(ActivityButton)) Public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof( int), typeof(ActivityButton), propert圜hanged: CornerRadiusUpdated) Public static readonly BindableProperty IsBusyProperty = BindableProperty.Create(nameof(IsBusy), typeof( bool), typeof(ActivityButton), propert圜hanged: IsBusyUpdated) Public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create(nameof(CommandParameter), typeof( object), typeof(ActivityButton), propert圜hanged: CommandParameterUpdated) Public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(ActivityButton), propert圜hanged: CommandUpdated) Public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof( string), typeof(ActivityButton), propert圜hanged: TextUpdated)

For instance, we will have a property in the code behind that allows us to tell the ActivityIndicator when to start running. We are able to use bindings to set BindableProperties on the ActivityButton.To do so, we just omit assiging a row or column to each element. Grids can sometimes be a good replacement for AbsoluteLayouts when you want to place certain things in front of one another.We use a Grid to display these elements on top of each other.We are able to use an ActivityIndicator and a Button in combination to achieve this look. As you might expect, there are two components that make up the ActivityButton.

There are a couple of things worth pointing out about this layout.
