From 1bc539ffbb2d0562192d74c3c459657d7ed8d9d1 Mon Sep 17 00:00:00 2001 From: Tian L <60599517+tian-lt@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:34:25 +0900 Subject: [PATCH] Fix #2146: SWIPE DELETE FUNCTION FREEZES APP (#2157) * fix stackoverflow * space --- src/Calculator/Views/Calculator.xaml.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Calculator/Views/Calculator.xaml.cs b/src/Calculator/Views/Calculator.xaml.cs index 32b70fa06..ccd42637d 100644 --- a/src/Calculator/Views/Calculator.xaml.cs +++ b/src/Calculator/Views/Calculator.xaml.cs @@ -189,7 +189,6 @@ public void InitializeHistoryView(CalculatorApp.ViewModel.HistoryViewModel histo } } - public void UpdatePanelViewState() { UpdateHistoryState(); @@ -772,7 +771,10 @@ private void OnMemoryFlyoutClosed(object sender, object args) private void SetChildAsMemory() { - DockMemoryHolder.Child = GetMemory(); + if (DockMemoryHolder.Child != GetMemory()) + { + DockMemoryHolder.Child = GetMemory(); + } } private void SetChildAsHistory() @@ -782,7 +784,10 @@ private void SetChildAsHistory() InitializeHistoryView(Model.HistoryVM); } - DockHistoryHolder.Child = m_historyList; + if (DockHistoryHolder.Child != m_historyList) + { + DockHistoryHolder.Child = m_historyList; + } } private Memory GetMemory()