Skip to content

Commit

Permalink
Merge pull request #4025 from unjong/patch-1
Browse files Browse the repository at this point in the history
Keep SelectedItemProperty Binding for ClearTextButton in ComboBox
  • Loading branch information
punker76 authored Feb 25, 2021
2 parents 8651210 + 33f45ae commit 3e73465
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MahApps.Metro/Controls/Helper/TextBoxHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -931,11 +931,11 @@ public static void ButtonClicked(object sender, RoutedEventArgs e)
{
if (comboBox.IsEditable)
{
comboBox.Text = string.Empty;
comboBox.SetCurrentValue(ComboBox.TextProperty, string.Empty);
comboBox.GetBindingExpression(ComboBox.TextProperty)?.UpdateSource();
}

comboBox.SelectedItem = null;
comboBox.SetCurrentValue(ComboBox.SelectedItemProperty, null);
comboBox.GetBindingExpression(ComboBox.SelectedItemProperty)?.UpdateSource();
}
else if (parent is ColorPickerBase colorPicker)
Expand Down Expand Up @@ -1020,4 +1020,4 @@ private static void ComboBoxLoaded(object sender, RoutedEventArgs e)
}
}
}
}
}

0 comments on commit 3e73465

Please sign in to comment.