Search This Blog

Tuesday, 8 February 2022

How To Define Xamarin Form Command Using Lambda Expression

Creating Command Without Command Parameter

public ICommand SignInCommand => new Command(async () =>
{
  // write logic to perform
});

Creating Command With Command Parameter

public ICommand SignInCommand => new Command<object>(async (item) =>
{
    if (item != null)
    {
      // write logic to perform
    }
});


Create Your First MAUI App

Step to Create First .NET MAUI App

Prerequisites: Download Visual Studio 2022 17.1 (Preview)

Step 1:  Open Visual Studio 2022 Preview, and click on Create a new Project. 


Step 2: Now Select the .NET MAUI App (Preview) Option and then click on Next Button:

Step 3: Configure your project and then click the Create button:


Step 4:  Click on Android Device Manager to Create Or Edit Android Emulator.


Step 5:  Create/Edit Android Emulator.


Step 6: Click on the Created Emulator from Visual Studio toolbar to build and run the app:



Popular Posts