Skip to content

Commit

Permalink
Non constrained PredefinedValues allow filter and set value
Browse files Browse the repository at this point in the history
Fixes #707
  • Loading branch information
netonjm committed Feb 18, 2020
1 parent 46748b5 commit 48707b9
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ private void RequireComboBox()
StringValue = String.Empty,
};

this.comboBox.SelectionChanged += (sender, e) => {
ViewModel.ValueName = this.comboBox.SelectedValue.ToString ();
};
this.comboBox.Activated += ComboBox_Activated;
this.comboBox.SelectionChanged += ComboBox_Activated;

AddSubview (this.comboBox);

Expand All @@ -173,5 +172,18 @@ private void RequireComboBox()
this.firstKeyView = this.comboBox;
this.lastKeyView = this.comboBox;
}

private void ComboBox_Activated (object sender, EventArgs e)
{
ViewModel.ValueName = this.comboBox.StringValue;
}

protected override void Dispose (bool disposing)
{
if (disposing) {
this.comboBox.Activated -= ComboBox_Activated;
this.comboBox.SelectionChanged -= ComboBox_Activated;
}
}
}
}

0 comments on commit 48707b9

Please sign in to comment.