Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146913 | Aug 25,2019 10:41 PM UTC | Aug 26,2019 09:03 AM UTC | Xamarin.Forms | 1 |
![]() |
Tags: SfButton |
<StackLayout>
<buttons:SfButton Text="Click Event" Clicked="SfButton_Clicked" HorizontalOptions="FillAndExpand" HeightRequest="40"/>
<buttons:SfButton Text="ICommand" Command="{Binding ToggleCommand}" HorizontalOptions="FillAndExpand" HeightRequest="40"/>
</StackLayout> |
private void SfButton_Clicked(object sender, EventArgs e)
{
// Task to perform on button click
}
//ViewModel
. . .
public ICommand ToggleCommand { private set; get; }
. . .
ToggleCommand = new Command(
execute: () =>
{
Console.WriteLine("This is execute of ToggleCommand!");
},
canExecute: () =>
{
return true;
});
. . . |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.