mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-02 07:09:27 +03:00
Merge pull request #31 from jdunlap/master
Clearing items in a DarkDropDown does not clear the menu
This commit is contained in:
commit
3f2b9bceb7
@ -80,6 +80,15 @@ namespace DarkUI.Collections
|
||||
ItemsRemoved(this, new ObservableListModified<T>(new List<T> { item }));
|
||||
}
|
||||
|
||||
public new void Clear()
|
||||
{
|
||||
ObservableListModified<T> removed = new ObservableListModified<T>(this.ToList<T>());
|
||||
base.Clear();
|
||||
|
||||
if (removed.Items.Count() > 0 && ItemsRemoved != null)
|
||||
ItemsRemoved(this, removed);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -257,6 +257,12 @@ namespace DarkUI.Controls
|
||||
}
|
||||
}
|
||||
|
||||
if (e.Action == NotifyCollectionChangedAction.Reset)
|
||||
{
|
||||
_menu.Items.Clear();
|
||||
SelectedItem = null;
|
||||
}
|
||||
|
||||
ResizeMenu();
|
||||
}
|
||||
|
||||
|
@ -566,6 +566,8 @@ namespace DarkUI.Controls
|
||||
if (IsDragging)
|
||||
return;
|
||||
|
||||
ContentSize = new Size(0, 0);
|
||||
|
||||
if (Nodes.Count == 0)
|
||||
return;
|
||||
|
||||
@ -573,9 +575,7 @@ namespace DarkUI.Controls
|
||||
var isOdd = false;
|
||||
var index = 0;
|
||||
DarkTreeNode prevNode = null;
|
||||
|
||||
ContentSize = new Size(0, 0);
|
||||
|
||||
|
||||
for (var i = 0; i <= Nodes.Count - 1; i++)
|
||||
{
|
||||
var node = Nodes[i];
|
||||
|
Loading…
x
Reference in New Issue
Block a user