mirror of https://github.com/AMT-Cheif/Stylet.git
Avoid binding to IEnumerable in MessageBoxView
According to dotMemory, this can cause a memory leak
This commit is contained in:
parent
0e48896a6d
commit
63a9c4a70f
|
@ -127,7 +127,7 @@ namespace Stylet
|
|||
this.DisplayName = caption;
|
||||
this.Icon = icon;
|
||||
|
||||
var buttonList = new List<LabelledValue<MessageBoxResult>>();
|
||||
var buttonList = new BindableCollection<LabelledValue<MessageBoxResult>>();
|
||||
this.ButtonList = buttonList;
|
||||
foreach (var val in ButtonToResults[buttons])
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ namespace Stylet
|
|||
/// <summary>
|
||||
/// Gets or sets the list of buttons which are shown in the View.
|
||||
/// </summary>
|
||||
public IEnumerable<LabelledValue<MessageBoxResult>> ButtonList { get; protected set; }
|
||||
public IObservableCollection<LabelledValue<MessageBoxResult>> ButtonList { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the item in ButtonList which is the Default button
|
||||
|
|
Loading…
Reference in New Issue