Exemplo n.º 1
0
        private void RegisterEditGroupingDialog(IShooterCollectionDataStore shooterCollectionDataStore)
        {
            _messenger.Register <EditGroupingDialogMessage>(this,
                                                            x =>
            {
                var m = new EditGroupingViewModel
                {
                    GroupingName = x.GroupingName,
                    GroupingId   = x.GroupingId,
                    Title        = "Gruppenname ändern"
                };

                IWindow w   = _vs.ExecuteFunction <EditGroupingViewModel, IWindow>((IWindow)Current.MainWindow, m);
                bool?result = w.ShowDialog();
                if (!result.HasValue || !result.Value)
                {
                    return;
                }

                ShooterCollection sc = shooterCollectionDataStore.FindById(m.GroupingId);
                sc.CollectionName    = m.GroupingName;
                shooterCollectionDataStore.Update(sc);

                _messenger.Send(new RefreshDataFromRepositoriesMessage());
            });
        }
Exemplo n.º 2
0
        private void RegisterEditGroupingDialog(IShooterCollectionDataStore shooterCollectionDataStore)
        {
            _messenger.Register<EditGroupingDialogMessage>(this,
                x =>
                {
                    var m = new EditGroupingViewModel
                    {
                        GroupingName = x.GroupingName,
                        GroupingId = x.GroupingId,
                        Title = "Gruppenname ändern"
                    };

                    IWindow w = _vs.ExecuteFunction<EditGroupingViewModel, IWindow>((IWindow) Current.MainWindow, m);
                    bool? result = w.ShowDialog();
                    if (!result.HasValue || !result.Value) return;

                    ShooterCollection sc = shooterCollectionDataStore.FindById(m.GroupingId);
                    sc.CollectionName = m.GroupingName;
                    shooterCollectionDataStore.Update(sc);

                    _messenger.Send(new RefreshDataFromRepositoriesMessage());
                });
        }