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.DisplayName = caption;
|
||||||
this.Icon = icon;
|
this.Icon = icon;
|
||||||
|
|
||||||
var buttonList = new List<LabelledValue<MessageBoxResult>>();
|
var buttonList = new BindableCollection<LabelledValue<MessageBoxResult>>();
|
||||||
this.ButtonList = buttonList;
|
this.ButtonList = buttonList;
|
||||||
foreach (var val in ButtonToResults[buttons])
|
foreach (var val in ButtonToResults[buttons])
|
||||||
{
|
{
|
||||||
|
@ -165,7 +165,7 @@ namespace Stylet
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the list of buttons which are shown in the View.
|
/// Gets or sets the list of buttons which are shown in the View.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<LabelledValue<MessageBoxResult>> ButtonList { get; protected set; }
|
public IObservableCollection<LabelledValue<MessageBoxResult>> ButtonList { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the item in ButtonList which is the Default button
|
/// Gets or sets the item in ButtonList which is the Default button
|
||||||
|
|
Loading…
Reference in New Issue