Fix delete key executing twice on mail list.
This commit is contained in:
@@ -405,6 +405,15 @@ namespace Wino.Controls.Advanced
|
|||||||
{
|
{
|
||||||
internalScrollviewer.ViewChanged -= InternalScrollVeiwerViewChanged;
|
internalScrollviewer.ViewChanged -= InternalScrollVeiwerViewChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var item in Items)
|
||||||
|
{
|
||||||
|
if (item is ThreadMailItemViewModel threadMailItemViewModel)
|
||||||
|
{
|
||||||
|
var threadListView = GetThreadInternalListView(threadMailItemViewModel);
|
||||||
|
threadListView?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,6 @@
|
|||||||
IsThreadListView="True"
|
IsThreadListView="True"
|
||||||
ItemTemplate="{StaticResource ThreadSingleMailItemTemplate}"
|
ItemTemplate="{StaticResource ThreadSingleMailItemTemplate}"
|
||||||
ItemsSource="{x:Bind ThreadItems}"
|
ItemsSource="{x:Bind ThreadItems}"
|
||||||
ProcessKeyboardAccelerators="ProcessMailItemKeyboardAccelerator"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Hidden">
|
ScrollViewer.VerticalScrollBarVisibility="Hidden">
|
||||||
<ListView.ItemContainerTransitions>
|
<ListView.ItemContainerTransitions>
|
||||||
<TransitionCollection>
|
<TransitionCollection>
|
||||||
@@ -438,7 +437,6 @@
|
|||||||
ItemTemplateSelector="{StaticResource MailItemDisplaySelector}"
|
ItemTemplateSelector="{StaticResource MailItemDisplaySelector}"
|
||||||
ItemsSource="{x:Bind MailCollectionViewSource.View, Mode=OneWay}"
|
ItemsSource="{x:Bind MailCollectionViewSource.View, Mode=OneWay}"
|
||||||
LoadMoreCommand="{x:Bind ViewModel.LoadMoreItemsCommand}"
|
LoadMoreCommand="{x:Bind ViewModel.LoadMoreItemsCommand}"
|
||||||
ProcessKeyboardAccelerators="ProcessMailItemKeyboardAccelerator"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto">
|
ScrollViewer.VerticalScrollBarVisibility="Auto">
|
||||||
<ListView.ItemContainerTransitions>
|
<ListView.ItemContainerTransitions>
|
||||||
<TransitionCollection>
|
<TransitionCollection>
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ namespace Wino.Views
|
|||||||
{
|
{
|
||||||
base.OnNavigatedFrom(e);
|
base.OnNavigatedFrom(e);
|
||||||
|
|
||||||
|
// Dispose all WinoListView items.
|
||||||
|
|
||||||
|
MailListView.Dispose();
|
||||||
|
|
||||||
this.Bindings.StopTracking();
|
this.Bindings.StopTracking();
|
||||||
|
|
||||||
RenderingFrame.Navigate(typeof(IdlePage));
|
RenderingFrame.Navigate(typeof(IdlePage));
|
||||||
@@ -347,16 +351,6 @@ namespace Wino.Views
|
|||||||
SearchBar.PlaceholderText = Translator.SearchBarPlaceholder;
|
SearchBar.PlaceholderText = Translator.SearchBarPlaceholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessMailItemKeyboardAccelerator(UIElement sender, ProcessKeyboardAcceleratorEventArgs args)
|
|
||||||
{
|
|
||||||
if (args.Key == Windows.System.VirtualKey.Delete)
|
|
||||||
{
|
|
||||||
args.Handled = true;
|
|
||||||
|
|
||||||
ViewModel?.ExecuteMailOperationCommand?.Execute(MailOperation.SoftDelete);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Thread header is mail info display control and it can be dragged spearately out of ListView.
|
/// Thread header is mail info display control and it can be dragged spearately out of ListView.
|
||||||
/// We need to prepare a drag package for it from the items inside.
|
/// We need to prepare a drag package for it from the items inside.
|
||||||
|
|||||||
Reference in New Issue
Block a user