Skip to content

Commit ae3ae50

Browse files
committed
two-way binding by default for Selected[Item|Index] in SplitButton
Using two-way binding by default for SelectedItem and SelectedIndex matches the behaviour of other controls like ComboBox
1 parent 9b07c07 commit ae3ae50

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MahApps.Metro/Controls/SplitButton.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ public event RoutedEventHandler Click
5353
DependencyProperty.Register("IsExpanded", typeof(bool), typeof(SplitButton));
5454

5555
public static readonly DependencyProperty SelectedIndexProperty =
56-
DependencyProperty.Register("SelectedIndex", typeof(Int32), typeof(SplitButton), new FrameworkPropertyMetadata(-1));
56+
DependencyProperty.Register("SelectedIndex", typeof(Int32), typeof(SplitButton),
57+
new FrameworkPropertyMetadata(-1, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
5758

5859
public static readonly DependencyProperty SelectedItemProperty =
59-
DependencyProperty.Register("SelectedItem", typeof(Object), typeof(SplitButton));
60+
DependencyProperty.Register("SelectedItem", typeof(Object), typeof(SplitButton),
61+
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
6062

6163
public static readonly DependencyProperty ExtraTagProperty =
6264
DependencyProperty.Register("ExtraTag", typeof(Object), typeof(SplitButton));

0 commit comments

Comments
 (0)