void ButtonClick(object sender, RoutedEventArgs e) { e.Handled = true; using (SharpDevelopColorDialog dlg = new SharpDevelopColorDialog()) { dlg.WpfColor = this.Value; if (dlg.ShowWpfDialog() == true) { // use SetCurrentValue instead of SetValue so that two-way data binding can be used SetCurrentValue(ValueProperty, dlg.WpfColor); } } }