示例#1
0
        private void OpenNewCommandViewModelMessageReceived(OpenNewCommandViewModelMessage message)
        {
            var vm = ClientCommandViewModels.FirstOrDefault(x => x.Match(message.ClientViewModel));

            if (vm != null)
            {
                SelectedClientCommandViewModel = vm;
            }
            else
            {
                var viewModel = _viewModelBuilder.BuildNewClientCommandViewModel();
                viewModel.Boot(message.ClientViewModel);
                ClientCommandViewModels.Add(viewModel);
                if (SelectedClientCommandViewModel == null)
                {
                    SelectedClientCommandViewModel = viewModel;
                }
            }
        }