Exemplo n.º 1
0
        private void OnCategorySelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var categoryName   = ((TextBlock)e.AddedItems[0]).Text;
            var categoryParams = databaseController.GetCategoryParams(categoryName);

            RefilCategoryParamsList(categoryParams);
        }
Exemplo n.º 2
0
        private void OnTypesListBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count != 1)
            {
                return;
            }

            var categoryName = (string)((Label)((Grid)e.AddedItems[0]).Children[0]).Content;

            CategoryCreateLabel.Content = $"Просмотр категории \"{categoryName}\"";
            CategoryCreateCategoryNameGrid.Visibility   = Visibility.Collapsed;
            CategoryCreateControlButtonsGrid.Visibility = Visibility.Collapsed;
            CategoryCreateParamsButtonsGrid.Visibility  = Visibility.Collapsed;
            CategoryCreateGrid.RowDefinitions[3].Height = GridLength.Auto;
            CategoryCreateGrid.RowDefinitions[4].Height = GridLength.Auto;

            CategoryCreateParamsListBox.Items.Clear();
            var categoryParams = databaseController.GetCategoryParams(categoryName);

            for (var i = 0; i < categoryParams.Length; i++)
            {
                CategoryCreateParamsListBox.Items.Add(new ListBoxItem {
                    Content = categoryParams[i], Foreground = Brushes.White, FontSize = 16
                });
            }

            CategoryCreateGrid.Visibility = Visibility.Visible;
        }