Пример #1
0
        public void Show(ViewModelBase viewModel)
        {
            StartViewViewModel vm = (StartViewViewModel)viewModel;

            this.lbFavorites.DataSource    = vm.FavoriteMessages;
            this.lbFavorites.DisplayMember = nameof(DefinedMessageViewModel.MessageText);
            this.lbFavorites.ValueMember   = nameof(DefinedMessageViewModel.Id);
            Visible = true;
        }
Пример #2
0
        public void Show()
        {
            view = context.CreateView(typeof(StartViewViewModel));
            var favorites = messageDefinitionService.GetFavoriteMessages()
                            .Select(x => new DefinedMessageViewModel()
            {
                MessageText = x.MessageText
            })
                            .ToList();
            var defined = messageDefinitionService.GetMessageDefinitions()
                          .Select(x => new DefinedMessageViewModel()
            {
                MessageText = x.MessageText
            })
                          .ToList();

            viewModel = new StartViewViewModel(defined, favorites);
            view.Show(viewModel);
        }