Пример #1
0
        public NameEditWindow(NameEditWindowViewModel viewModel)
        {
            this.DataContext      = viewModel;
            viewModel.CloseEvent += (sender, e) => this.Close();

            InitializeComponent();
        }
Пример #2
0
        public void ShowDialog(NameEditWindowViewModel viewModel)
        {
            var window = new NameEditWindow(viewModel);

            window.Owner = App.Current.MainWindow;
            window.ShowDialog();
        }
Пример #3
0
        public NameEditWindow(NameEditWindowViewModel viewModel)
        {
            this.DataContext      = viewModel;
            viewModel.CloseEvent += (sender, e) => this.Close();

            InitializeComponent();

            this.MouseLeftButtonDown += (sender, e) => this.DragMove();
        }
        private void SignatureNew()
        {
            var viewModel = new NameEditWindowViewModel("Anonymous", Signature.MaxNameLength);

            viewModel.Callback += (name) =>
            {
                var digitalSignature = new DigitalSignature(name, DigitalSignatureAlgorithm.EcDsaP521_Sha256_v3);
                this.AccountOptions.DigitalSignature = digitalSignature;
            };

            _dialogService.Show(viewModel);
        }
Пример #5
0
        private void TabEdit()
        {
            if (this.TabSelectedItem.Value is StoreCategoryViewModel categoryViewModel)
            {
                var viewModel = new NameEditWindowViewModel(categoryViewModel.Name.Value, 256);
                viewModel.Callback += (name) =>
                {
                    categoryViewModel.Model.Name = name;
                };

                _dialogService.ShowDialog(viewModel);
            }
        }
Пример #6
0
        private void TabEdit()
        {
            var viewModel = new NameEditWindowViewModel(this.TabSelectedItem.Value.Name.Value, 256);

            viewModel.Callback += (name) =>
            {
                var chatCategoryViewModel = this.TabSelectedItem.Value as ChatCategoryViewModel;
                if (chatCategoryViewModel == null)
                {
                    return;
                }

                chatCategoryViewModel.Model.Name = name;
            };

            _dialogService.ShowDialog(viewModel);
        }
Пример #7
0
        private void TabNewCategory()
        {
            if (this.TabSelectedItem.Value is StoreCategoryViewModel categoryViewModel)
            {
                var viewModel = new NameEditWindowViewModel("", 256);
                viewModel.Callback += (name) =>
                {
                    categoryViewModel.Model.CategoryInfos.Add(new StoreCategoryInfo()
                    {
                        Name = name
                    });
                };

                _dialogService.ShowDialog(viewModel);
            }

            this.Refresh();
        }
Пример #8
0
        private void TabNewCategory()
        {
            var viewModel = new NameEditWindowViewModel("", 256);

            viewModel.Callback += (name) =>
            {
                var chatCategoryViewModel = this.TabSelectedItem.Value as ChatCategoryViewModel;
                if (chatCategoryViewModel == null)
                {
                    return;
                }

                chatCategoryViewModel.Model.CategoryInfos.Add(new ChatCategoryInfo()
                {
                    Name = name
                });
            };

            _dialogService.ShowDialog(viewModel);
        }
Пример #9
0
        private void Edit()
        {
            object selectedModel = this.SelectedItems.OfType <StoreListViewItemInfo>().Select(n => n.Model).FirstOrDefault();

            if (selectedModel == null)
            {
                return;
            }

            if (selectedModel is StoreCategoryInfo categoryInfo)
            {
                var viewModel = new NameEditWindowViewModel(categoryInfo.Name, 256);
                viewModel.Callback += (name) =>
                {
                    categoryInfo.Name = name;
                };

                _dialogService.ShowDialog(viewModel);
            }

            this.Refresh();
        }
Пример #10
0
        private void NewCategory()
        {
            var categoryInfo = this.SelectedItems.OfType <StoreListViewItemInfo>().Select(n => n.Model).FirstOrDefault() as StoreCategoryInfo;

            if (categoryInfo == null)
            {
                this.TabNewCategory();
                return;
            }

            var viewModel = new NameEditWindowViewModel("", 256);

            viewModel.Callback += (name) =>
            {
                categoryInfo.CategoryInfos.Add(new StoreCategoryInfo()
                {
                    Name = name
                });
            };

            _dialogService.ShowDialog(viewModel);

            this.Refresh();
        }