Skip to content

Commit 26b8f40

Browse files
committed
Merge pull request #1798 from Envisage/fix-splitbutton-selected
Fix SplitButton SelectedIndex and SelectedItem
2 parents 46c5bbd + ae3ae50 commit 26b8f40

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(0));
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)