How to programatically add Spin event to DevExpress WPF SpinEdit Control?
* Why can’t DevExpress WPF works just like default WPF controls 🙁
XAML:
<dxb:BarEditItem x:Name="spinEdit">
<dxb:BarEditItem.EditSettings>
<dxe:SpinEditSettings />
</dxb:BarEditItem.EditSettings>
</dxb:BarEditItem>
C#:
public MainWindow()
{
InitializeComponent();
barManager1.LayoutUpdated += new EventHandler(barManager1_LayoutUpdated);
}
void barManager1_LayoutUpdated(object sender, EventArgs e)
{
if (spindEditItemLink.Editor != null)
{
spindEditItemLink..???.. += new ????(spinEdit1_Spin);
barManager1.LayoutUpdated -= new EventHandler(barManager1_LayoutUpdated);
}
}
void spinEdit1_Spin(object sender, EventArgs e)
{
MessageBox.Show("Foo");
}
You can attach an event handler to the SpinEdit.Spin event via the editor style: