Fix unrealized container unselected issue with the threads.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using CommunityToolkit.WinUI;
|
using CommunityToolkit.WinUI;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
@@ -25,10 +24,13 @@ public partial class WinoMailItemViewModelListViewItem : ListViewItem
|
|||||||
partial void OnItemPropertyChanged(DependencyPropertyChangedEventArgs e)
|
partial void OnItemPropertyChanged(DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
// TODO: This slows down. Optimize later.
|
// TODO: This slows down. Optimize later.
|
||||||
Debug.WriteLine("WinoMailItemViewModelListViewItem item changed");
|
|
||||||
|
|
||||||
if (e.OldValue is MailItemViewModel oldMailItemViewModel) UnregisterPropertyChanged(oldMailItemViewModel);
|
if (e.OldValue is MailItemViewModel oldMailItemViewModel) UnregisterPropertyChanged(oldMailItemViewModel);
|
||||||
if (e.NewValue is MailItemViewModel newMailItemViewModel) RegisterPropertyChanged(newMailItemViewModel);
|
if (e.NewValue is MailItemViewModel newMailItemViewModel) RegisterPropertyChanged(newMailItemViewModel);
|
||||||
|
|
||||||
|
if (e.NewValue is MailItemViewModel mailItemViewModel)
|
||||||
|
IsCustomSelected = mailItemViewModel.IsSelected;
|
||||||
|
else
|
||||||
|
IsCustomSelected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RegisterPropertyChanged(MailItemViewModel model) => model.PropertyChanged += ModelPropertyChanged;
|
private void RegisterPropertyChanged(MailItemViewModel model) => model.PropertyChanged += ModelPropertyChanged;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using CommunityToolkit.WinUI;
|
using CommunityToolkit.WinUI;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
@@ -41,8 +40,6 @@ public partial class WinoThreadMailItemViewModelListViewItem : ListViewItem
|
|||||||
|
|
||||||
partial void OnItemPropertyChanged(DependencyPropertyChangedEventArgs e)
|
partial void OnItemPropertyChanged(DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
Debug.WriteLine("WinoMailItemViewModelListViewItem item changed");
|
|
||||||
|
|
||||||
if (e.OldValue is ThreadMailItemViewModel oldMailItemViewModel) UnregisterPropertyChanged(oldMailItemViewModel);
|
if (e.OldValue is ThreadMailItemViewModel oldMailItemViewModel) UnregisterPropertyChanged(oldMailItemViewModel);
|
||||||
if (e.NewValue is ThreadMailItemViewModel newMailItemViewModel) RegisterPropertyChanged(newMailItemViewModel);
|
if (e.NewValue is ThreadMailItemViewModel newMailItemViewModel) RegisterPropertyChanged(newMailItemViewModel);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user