private async void CopyAsProfileAction() { CustomDialog customDialog = new CustomDialog() { Title = LocalizationManager.GetStringByKey("String_Header_CopyClient") }; WakeOnLANClientViewModel wakeOnLANClientViewModel = new WakeOnLANClientViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); WakeOnLANClientInfo wakeOnLANClientInfo = new WakeOnLANClientInfo { Name = instance.Name, MACAddress = instance.MACAddress, Broadcast = instance.Broadcast, Port = instance.Port, Group = instance.Group }; WakeOnLANClientManager.AddClient(wakeOnLANClientInfo); }, instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, WakeOnLANClientManager.GetClientGroups(), SelectedClient); customDialog.Content = new WakeOnLANClientDialog { DataContext = wakeOnLANClientViewModel }; await dialogCoordinator.ShowMetroDialogAsync(this, customDialog); }
private async void EditClientAction() { CustomDialog customDialog = new CustomDialog() { Title = Application.Current.Resources["String_Header_EditClient"] as string }; WakeOnLANClientViewModel wakeOnLANClientViewModel = new WakeOnLANClientViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); WakeOnLANClientManager.RemoveClient(SelectedClient); WakeOnLANClientInfo wakeOnLANClientInfo = new WakeOnLANClientInfo { Name = instance.Name, MACAddress = instance.MACAddress, Broadcast = instance.Broadcast, Port = instance.Port, Group = instance.Group }; WakeOnLANClientManager.AddClient(wakeOnLANClientInfo); }, instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, WakeOnLANClientManager.GetClientGroups(), SelectedClient); customDialog.Content = new WakeOnLANClientDialog { DataContext = wakeOnLANClientViewModel }; await dialogCoordinator.ShowMetroDialogAsync(this, customDialog); }