The ButtonInfo class implements the functionality of an individual button that can be displayed within button editors (e.g., ButtonEdit, DateEdit, etc.).

Example
This example shows how to create a new edit button with a custom glyph in code.
MainWindow.xaml |
<Window x:Class="DXEditors_HowToCreateButtonEdit.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<Grid>
<dxe:ButtonEdit
HorizontalAlignment="Left" Margin="176,129,0,0" Height="22"
Name="btnEdit" VerticalAlignment="Top" Width="150" />
</Grid>
</Window>
|
MainWindow.xaml.cs |
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using DevExpress.Xpf.Editors;
namespace DXEditors_HowToCreateButtonEdit {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
CreateEditButton(btnEdit, @"/DXEditors_HowToCreateButtonEdit;component\plus.png");
}
private void CreateEditButton(ButtonEdit edit, string imgUri) {
BitmapImage bitmap = new BitmapImage(new Uri(imgUri, UriKind.Relative));
Image imgSource = new Image() { Source = bitmap };
ButtonInfo btnInfo = new ButtonInfo() { GlyphKind = GlyphKind.User, Content = imgSource };
edit.Buttons.Add(btnInfo);
}
}
}
|
MainWindow.xaml.vb |
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Media.Imaging
Imports DevExpress.Xpf.Editors
Namespace DXEditors_HowToCreateButtonEdit
''' <summary>
''' Interaction logic for MainWindow.xaml
''' </summary>
Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
CreateEditButton(btnEdit, "/DXEditors_HowToCreateButtonEdit;component\plus.png")
End Sub
Private Sub CreateEditButton(ByVal edit As ButtonEdit, ByVal imgUri As String)
Dim bitmap As New BitmapImage(New Uri(imgUri, UriKind.Relative))
Dim imgSource As New Image() With {.Source = bitmap}
Dim btnInfo As New ButtonInfo() With {.GlyphKind = GlyphKind.User, .Content = imgSource}
edit.Buttons.Add(btnInfo)
End Sub
End Class
End Namespace
|
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.ContentElement
System.Windows.FrameworkContentElement
ButtonInfoBase
ButtonInfo