/// <summary> /// Constructor /// </summary> /// <param name="vm">The view model</param> public SendButton(SendToViewModel vm) { ViewModel = vm; RecipientsList = (ListBox)ViewModel.Content.FindName("RecipientsList"); // Whenever a new user is selected from the list, check if the button can be clicked RecipientsList.SelectionChanged += delegate { CanExecuteChanged?.Invoke(this, EventArgs.Empty); }; }
public SendToWindow(string path) { InitializeComponent(); ViewModel = new SendToViewModel(this, path); DataContext = ViewModel; }