More pattern matching.

This commit is contained in:
2022-11-14 01:49:10 +00:00
parent 8a511d0d44
commit 040b4eab4e
18 changed files with 33 additions and 57 deletions

View File

@@ -522,9 +522,7 @@ public sealed class MainWindowViewModel : ViewModelBase
try
{
var imageFormat = ImageFormat.Detect(inputFilter) as IMediaImage;
if(imageFormat == null)
if(ImageFormat.Detect(inputFilter) is not IMediaImage imageFormat)
{
MessageBoxManager.GetMessageBoxStandardWindow("Error", "Image format not identified.", ButtonEnum.Ok,
Icon.Error);