diff --git a/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs b/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs
index abf798bf..9ea24814 100644
--- a/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs
+++ b/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs
@@ -4,7 +4,7 @@
using Trimble.Modus.Components.Popup.Services;
namespace Trimble.Modus.Components;
-public partial class TMDropDown : ContentView, IDisposable
+public partial class TMDropDown : ContentView
{
#region Private fields
private double desiredHeight;
@@ -136,6 +136,7 @@ public TMDropDown()
InitializeComponent();
this.SetDynamicResource(StyleProperty, "DefaultStyle");
PopupService.Instance.Dismissed += OnPopupRemoved;
+ this.Unloaded += OnUnloaded;
}
#endregion
@@ -383,8 +384,16 @@ protected override void OnHandlerChanged()
public void Dispose()
{
PopupService.Instance.Dismissed -= OnPopupRemoved;
+ this.Unloaded -= OnUnloaded;
SelectionChanged = null;
SelectionChangedCommand = null;
ItemsSource = null;
+ dropDownContents = null;
+ previousSelection = null;
+ }
+
+ private void OnUnloaded(object sender, EventArgs e)
+ {
+ Dispose();
}
}
diff --git a/Trimble.Modus.Components/Trimble.Modus.Components.csproj b/Trimble.Modus.Components/Trimble.Modus.Components.csproj
index fa5dd094..9e79facc 100644
--- a/Trimble.Modus.Components/Trimble.Modus.Components.csproj
+++ b/Trimble.Modus.Components/Trimble.Modus.Components.csproj
@@ -27,7 +27,7 @@