步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB

3 years ago
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System.Windows.Input;
using System;
using System.Windows;
3 years ago
namespace BBWY.Client.ViewModels
{
public class BaseVM : ViewModelBase
{
public Guid VMId { get; set; }
public ICommand LoadCommand { get; set; }
3 years ago
public ICommand UnloadCommand { get; set; }
public ICommand CopyTextCommand { get; set; }
3 years ago
public BaseVM()
{
VMId = Guid.NewGuid();
LoadCommand = new RelayCommand(Load);
3 years ago
UnloadCommand = new RelayCommand(Unload);
CopyTextCommand = new RelayCommand<string>(s =>
{
try
{
Clipboard.SetText(s);
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(ex);
Console.ResetColor();
}
});
3 years ago
}
3 years ago
public virtual void Refresh()
{
}
3 years ago
protected virtual void Load()
{
}
3 years ago
protected virtual void Unload()
3 years ago
{
3 years ago
}
3 years ago
}
}