private void AddTypeButton_Click(object sender, RoutedEventArgs e)
        {
            TreeViewItem selectedItem       = CategoryTree.SelectedItem as TreeViewItem;
            TypeDigest   typeCategoryDigest = (TypeDigest)selectedItem.Tag;

            TypeDigestViewModel viewModel = new TypeDigestViewModel(new TypeDigest()
            {
                TypeCategoryId = typeCategoryDigest.Id,
                Edit           = DateTime.Now,
                Open           = DateTime.Now,
                Close          = new DateTime(2100, 1, 1)
            });

            TypeDigestInsertWindow typeDigestInsertWindow = new TypeDigestInsertWindow();

            typeDigestInsertWindow.ViewModel = viewModel;
            typeDigestInsertWindow.Show();
        }
        private void CategoryTypeDigestInsertMenuItem_Click(object sender, RoutedEventArgs e)
        {
            TreeViewItem selectedItem = CategoryTree.SelectedItem as TreeViewItem;
            TypeDigest   categoryType = selectedItem.Tag as TypeDigest;

            TypeDigestViewModel viewModel = new TypeDigestViewModel(new TypeDigest()
            {
                TypeCategoryId = categoryType.Id,
                Edit           = DateTime.Now,
                Open           = DateTime.Now,
                Close          = new DateTime(2100, 1, 1)
            });

            TypeDigestInsertWindow typeDigestInsertWindow = new TypeDigestInsertWindow();

            typeDigestInsertWindow.ViewModel = viewModel;
            typeDigestInsertWindow.Show();
        }
        private void CategoryMenuItemInsert_Click(object sender, RoutedEventArgs e)
        {
            TreeViewItem selectedItem = CategoryTree.SelectedItem as TreeViewItem;

            int parentId   = (selectedItem.Tag as TypeDigest).Id;
            int categoryId = _typeRepository.GetRootCategoryTypeDigest().Match(
                None: () => - 1,
                Some: t => t.Id
                );

            TypeDigestViewModel viewModel = new TypeDigestViewModel(new TypeDigest()
            {
                ParentId       = parentId,
                TypeCategoryId = categoryId,
                Edit           = DateTime.Now,
                Open           = DateTime.Now,
                Close          = new DateTime(2100, 1, 1)
            });

            TypeDigestInsertWindow typeDigestInsertWindow = new TypeDigestInsertWindow();

            typeDigestInsertWindow.ViewModel = viewModel;
            typeDigestInsertWindow.Show();
        }