mirror of https://github.com/dahall/Vanara.git
Fixed bug in collection where parent wasn't set
parent
e2ff8ebbd7
commit
54994c84bf
|
@ -13,7 +13,7 @@ namespace Vanara.Windows.Shell
|
||||||
/// <summary>Initializes a new instance of the <see cref="ThumbnailToolbar"/> class.</summary>
|
/// <summary>Initializes a new instance of the <see cref="ThumbnailToolbar"/> class.</summary>
|
||||||
public ThumbnailToolbar()
|
public ThumbnailToolbar()
|
||||||
{
|
{
|
||||||
Buttons = new ThumbnailToolbarButtonCollection();
|
Buttons = new ThumbnailToolbarButtonCollection(this);
|
||||||
Buttons.CollectionChanged += (s, e) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Buttons)));
|
Buttons.CollectionChanged += (s, e) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Buttons)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,11 @@ namespace Vanara.Windows.Shell
|
||||||
public class ThumbnailToolbarButtonCollection : ObservableCollection<ThumbnailToolbarButton>
|
public class ThumbnailToolbarButtonCollection : ObservableCollection<ThumbnailToolbarButton>
|
||||||
{
|
{
|
||||||
private const int maxBtns = 7;
|
private const int maxBtns = 7;
|
||||||
|
private readonly ThumbnailToolbar Parent;
|
||||||
|
|
||||||
internal ThumbnailToolbarButtonCollection()
|
internal ThumbnailToolbarButtonCollection(ThumbnailToolbar parent)
|
||||||
{
|
{
|
||||||
|
Parent = parent;
|
||||||
CollectionChanged += OnCollectionChanged;
|
CollectionChanged += OnCollectionChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue