Skip to content

DevExpress-Examples/wpf-dialogservice-customize-dialog-buttons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF DialogService - Customize Dialog Buttons

Our WPF DialogService allows you to invoke a dialog window from the View Model code. The service's ShowDialog method accepts parameters that specify the window title, buttons, and so on. You can select buttons from the MessageButton enumeration or create a collection of UICommand objects. This example demonstrates how to change the position of buttons generated from UICommand objects.

image

Implementation Details

Dialog buttons are objects of the ThemedWindowDialogButton class. You can explicitly add these buttons to the dialog View:

  1. Create ThemedWindowDialogButton objects and define their properties.
  2. Add these objects to the ThemedWindowDialogButtonsControl container and specify its position.
  3. Set the ThemedWindowOptions.UseCustomDialogFooter attached property to true to hide auto-generated buttons.

The ThemedWindowDialogButton class contains UICommand and DialogResult properties. These properties allow you to specify the value returned by the ShowDialog method when a user clicks the button.

If you use dialog buttons from the MessageButton enumeration, you can use the approach from the following example instead: WPF DialogService - Close an Opened Dialog and Specify the Dialog Result. This example demonstrates how to create a command that uses the CurrentDialogService to close the dialog with the specified result.

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Customize buttons displayed in the DialogService window

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5