Files
FileConverter/Application/FileConverter/ViewModels/DiagnosticsViewModel.cs
T
Adrien Allard 2c8fe8a4c7 Remove deprecated dependencies
- Remove CommonServiceLocator
- Remove GalaSoft.MvvmLight
- Add CommunityToolkit.Mvvm
2024-01-17 16:13:54 +01:00

48 lines
1.4 KiB
C#

// <copyright file="DiagnosticsViewModel.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter.ViewModels
{
using System.ComponentModel;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Input;
using FileConverter.Services;
/// <summary>
/// This class contains properties that the diagnostics View can data bind to.
/// </summary>
public class DiagnosticsViewModel : ObservableRecipient
{
private RelayCommand<CancelEventArgs> closeCommand;
/// <summary>
/// Initializes a new instance of the DiagnosticsViewModel class.
/// </summary>
public DiagnosticsViewModel()
{
}
public ICommand CloseCommand
{
get
{
if (this.closeCommand == null)
{
this.closeCommand = new RelayCommand<CancelEventArgs>(this.Close);
}
return this.closeCommand;
}
}
private void Close(CancelEventArgs args)
{
INavigationService navigationService = Ioc.Default.GetRequiredService<INavigationService>();
navigationService.Close(Pages.Diagnostics, args != null);
}
}
}