This example shows how to create a custom command provider that inherits from the ReportDesignerCommands class and overrides the SaveDocumentAs method to write text to the debug output.
Files to Review
Documentation
More Examples
- Reporting for WPF - How to Customize Keyboard Shortcuts
- Reporting for WPF - How to Customize the Ribbon Toolbar
- Reporting for WPF - How to customize context menus in the Report Designer
- Reporting for WPF - Customize a Control's Smart Tag
- WPF Report Designer - How to hide properties of reports and their elements
Does this example address your development requirements/objectives?
(you will be redirected to DevExpress.com to submit your response)
Example Code
XAML<Window
x:Class="T461334.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxrud="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner"
Title="MainWindow" Height="800" Width="1200"
FocusManager.FocusedElement="{Binding ElementName=designer}">
<dxrud:ReportDesigner Name="designer" />
</Window>
C#using System.Diagnostics;
using System.Windows;
using DevExpress.Xpf.Reports.UserDesigner;
namespace T461334 {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
designer.Commands = new CustomDesignerCommands();
Loaded += MainWindow_Loaded;
}
void MainWindow_Loaded(object sender, RoutedEventArgs e) {
designer.OpenDocument(new SampleReport());
}
}
public class CustomDesignerCommands : ReportDesignerCommands {
protected override void SaveDocumentAs() {
Debug.WriteLine("CustomDesignerCommands.SaveDocumentAs");
base.SaveDocumentAs();
}
}
}