Skip to content

Commit

Permalink
Merge pull request #84 from MADE-Apps/feature/richedittoolbar-customo…
Browse files Browse the repository at this point in the history
…ptionfix

#66 - Added change to ensure that custom options for RichEditToolbar are cleared properly
  • Loading branch information
tom-made committed May 28, 2022
2 parents ffe53f2 + b4d6195 commit 23be8a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/MADE.UI.Controls.RichEditToolbar/RichEditToolbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public partial class RichEditToolbar : Control, IRichEditToolbar
public RichEditToolbar()
{
this.DefaultStyleKey = typeof(RichEditToolbar);
this.Unloaded += OnUnloaded;
}

#if WINDOWS_UWP
Expand Down Expand Up @@ -167,6 +168,16 @@ private void SetupCustomOptions()
}
}

private void OnUnloaded(object sender, RoutedEventArgs e)
{
this.ClearCustomOptions();
}

private void ClearCustomOptions()
{
this.CustomOptions?.Clear();
}

private void ResetCustomOptions()
{
if (this.Toolbar == null || this.CustomOptions == null)
Expand Down

0 comments on commit 23be8a2

Please sign in to comment.