Ejemplo n.º 1
0
        private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedItem = (ItemInDataGrid)((DataGridRow)sender).DataContext;

            selectedItemName.Content     = $"Товар: {selectedItem.Name}";
            selectedItemCategory.Content = $"Категория: {selectedItem.Category}";
            selectedItemPrice.Content    = $"Цена: {selectedItem.Price}";
            selectedItemCount.Content    = $"В наличии: {selectedItem.Count}";
            selectedItemDescription.Text = selectedItem.Description;

            var uid = selectedItem.UID;

            addButton.Tag       = uid;
            subButton.Tag       = uid;
            StatisticButton.Tag = uid;
            EditButton.Tag      = uid;

            SelectedItemCharacteristics.Items.Clear();
            var itemParams = databaseController.GetItemParams(uid);

            foreach (var param in itemParams)
            {
                SelectedItemCharacteristics.Items.Add(new Label {
                    Content = $"{param.Key}: {param.Value}", FontSize = 16, Foreground = Brushes.White
                });
            }

            ShowOrHideItemInterface(true);
        }