mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-23 11:02:33 +01:00
- Remove CommonServiceLocator - Remove GalaSoft.MvvmLight - Add CommunityToolkit.Mvvm
48 lines
1.4 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|