Skip to main content
All docs
V25.2
  • ReportDesigner.RegisterControl<T>(ImageSource) Method

    Registers a custom control with a specified icon in the Report Designer and adds it to the Toolbox.

    Namespace: DevExpress.Xpf.Reports.UserDesigner

    Assembly: DevExpress.Xpf.ReportDesigner.v25.2.dll

    NuGet Package: DevExpress.Wpf.Reporting

    Declaration

    public static void RegisterControl<T>(
        ImageSource icon
    )
        where T : XRControl, new()

    Parameters

    Name Type Description
    icon ImageSource

    An image source of a control’s icon.

    Type Parameters

    Name Description
    T

    The control’s type.

    Remarks

    The following example registers a custom control with a specified icon in the Report Designer. This control appears in the Toolbox.

    Tip

    To use a predefined icon (or an icon from an assembly) for a custom control, call the RegisterControl<T>() method instead.

    using DevExpress.Xpf.Core.Native;
    using DevExpress.Xpf.Reports.UserDesigner;
    using DevExpress.XtraReports.UI;
    using System.Windows;
    using System.Windows.Media;
    //...
    
    public class ProgressBar : XRControl { /* ... */ }
    //...
    
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
    
            ImageSource icon = WpfSvgRenderer.CreateImageSource(new Uri("path/to/progress_bar.svg"));
            ReportDesigner.RegisterControl<ProgressBar>(icon);
        }
    
        private void Window_Loaded(object sender, RoutedEventArgs e) {
            reportDesigner.OpenDocument(new XtraReport());
        }
    }
    

    Tip

    To unregister a control and remove it from the Toolbox, use the UnregisterControl<T>() method.

    See Also