Skip to content

Commit 23be8a2

Browse files
authored
Merge pull request #84 from MADE-Apps/feature/richedittoolbar-customoptionfix
#66 - Added change to ensure that custom options for RichEditToolbar are cleared properly
2 parents ffe53f2 + b4d6195 commit 23be8a2

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)