ComboBox. Use SuperView to determine if control has been added to a container view

This commit is contained in:
Ross Ferguson
2020-06-30 17:49:41 +01:00
parent 0f4ddf44c5
commit 4790a52639

View File

@@ -29,7 +29,8 @@ namespace Terminal.Gui {
set {
source = value;
if(isAdded) {
// Only need to refresh list if its been added to a container view
if(SuperView != null && SuperView.Subviews.Contains(this)) {
Search_Changed ("");
SetNeedsDisplay ();
}
@@ -66,7 +67,6 @@ namespace Terminal.Gui {
readonly TextField search;
readonly ListView listview;
bool autoHide = true;
bool isAdded;
/// <summary>
/// Public constructor
@@ -163,8 +163,6 @@ namespace Terminal.Gui {
} else {
search.ColorScheme = Colors.Menu;
}
isAdded = true;
};
}