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.

34 lines
765 B

2 years ago
using CommandSample.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace CommandSample.ViewModels
{
internal class MessageViewModel
{
public MessageCommand DisplayMessageCommand { get; set; }
public MessageViewModel()
{
this.DisplayMessageCommand = new MessageCommand(DisplayMessage, AddMessage);
}
public void DisplayMessage(string param)
{
MessageBox.Show($"Clicked! (Param: {param})");
}
public bool AddMessage(string param)
{
if (string.IsNullOrEmpty(param))
return false;
return true;
}
}
}