MessageDialog Commands

How to use MessageDialog Commands in a Windows Store app
  • 2399

using Windows.UI.Popups;


Commands

Buttons are very important part of a message dialog if your application expect an input from a user. OK, Cancel, Yes, and No buttons are typical message dialog buttons. The MessageDialog class has a command bar that can support up to three commands. The Commands property is used to add and read commands.

The following code snippet adds two commands to the command bar of a MessageDialog.

// Add commands and set their callbacks. You can create a single callback

// Or create a separate callback for different commands

messageDialog.Commands.Add(new UICommand(

    "OK", new UICommandInvokedHandler(this.CommandInvokedHandler)));

messageDialog.Commands.Add(new UICommand(

    "Close", new UICommandInvokedHandler(this.CommandInvokedHandler)));


Here is complete sample code >>


Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.