ResultsViewModel.cs
1 #pragma warning disable IDE0073 2 // Copyright (c) Brice Lambson 3 // The Brice Lambson licenses this file to you under the MIT license. 4 // See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ 5 #pragma warning restore IDE0073 6 7 using System.Collections.Generic; 8 using System.Windows.Input; 9 10 using ImageResizer.Helpers; 11 using ImageResizer.Models; 12 using ImageResizer.Views; 13 14 namespace ImageResizer.ViewModels 15 { 16 public class ResultsViewModel : Observable 17 { 18 private readonly IMainView _mainView; 19 20 public ResultsViewModel(IMainView mainView, IEnumerable<ResizeError> errors) 21 { 22 _mainView = mainView; 23 Errors = errors; 24 CloseCommand = new RelayCommand(Close); 25 } 26 27 public IEnumerable<ResizeError> Errors { get; } 28 29 public ICommand CloseCommand { get; } 30 31 public void Close() => _mainView.Close(); 32 } 33 }