Skip to content

Commit b4d6195

Browse files
committed
Added change to ensure that custom options for RichEditToolbar are cleared when the control is unloaded to ensure that they are correctly re-initialized
1 parent ffe53f2 commit b4d6195

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/MADE.UI.Controls.RichEditToolbar/RichEditToolbar.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public partial class RichEditToolbar : Control, IRichEditToolbar
5151
public RichEditToolbar()
5252
{
5353
this.DefaultStyleKey = typeof(RichEditToolbar);
54+
this.Unloaded += OnUnloaded;
5455
}
5556

5657
#if WINDOWS_UWP
@@ -167,6 +168,16 @@ private void SetupCustomOptions()
167168
}
168169
}
169170

171+
private void OnUnloaded(object sender, RoutedEventArgs e)
172+
{
173+
this.ClearCustomOptions();
174+
}
175+
176+
private void ClearCustomOptions()
177+
{
178+
this.CustomOptions?.Clear();
179+
}
180+
170181
private void ResetCustomOptions()
171182
{
172183
if (this.Toolbar == null || this.CustomOptions == null)

0 commit comments

Comments
 (0)