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; } } }