mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-19 15:03:36 +08:00
Reset Sources on Peek close
This commit is contained in:
parent
675aac95d2
commit
6b63e809ef
@ -68,6 +68,13 @@ namespace Peek.FilePreviewer
|
||||
_cancellationTokenSource.Dispose();
|
||||
}
|
||||
|
||||
public void ResetSource()
|
||||
{
|
||||
ImagePreview.Source = null;
|
||||
VideoPreview.Source = null;
|
||||
BrowserPreview.Source = null;
|
||||
}
|
||||
|
||||
private async void Previewer_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
// Fallback on DefaultPreviewer if we fail to load the correct Preview
|
||||
|
@ -35,6 +35,7 @@
|
||||
NumberOfFiles="{x:Bind ViewModel.Items.Count, Mode=OneWay}" />
|
||||
|
||||
<fp:FilePreview
|
||||
Name="FilePreviewer"
|
||||
Grid.Row="1"
|
||||
Item="{x:Bind ViewModel.CurrentItem, Mode=OneWay}"
|
||||
PreviewSizeChanged="FilePreviewer_PreviewSizeChanged"
|
||||
|
@ -89,6 +89,7 @@ namespace Peek.UI
|
||||
|
||||
ViewModel.Uninitialize();
|
||||
ViewModel.ScalingFactor = 1;
|
||||
FilePreviewer.ResetSource();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user