public void InitializeCurrentObject() { textBoxName.Text = importedObject.Name; textBoxDescription.Text = importedObject.Description; textBoxInitialPrice.Text = Math.Round(importedObject.InitialPrice, 2).ToString(); currentObject = importedObject.GetInnerObject(); }
private void treeViewCategory_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { TreeViewItem selectedTreeViewItem = treeViewCategory.SelectedItem as TreeViewItem; if (treeViewCategory.Items.Count > 0 && selectedTreeViewItem != null) { FurnitureObject currentObject = (selectedTreeViewItem.Header as ExtendedTreeViewItem).Tag as FurnitureObject; if (currentObject != null) { SelectedObject = currentObject.GetInnerObject(); selectedObjectMaterials.Clear(); selectedObjectMaterials.AddRange(currentObject.GetInnerObject().GetMaterials()); SelectedObject.Name = currentObject.Name; SelectedObject.InitialPrice = currentObject.InitialPrice; if (SelectedObject != null) { //InitializeSelectedObjectMaterials(); groupBoxObj.Visibility = Visibility.Visible; groupBoxPrices.Visibility = Visibility.Visible; InitializeMaterials(); selectedObjectInitialPrice = currentObject.InitialPrice; InitializePrices(); InitializeDimensions(); checkBoxIsSuspendable.IsChecked = false; textBoxChosenHeight.Text = ""; } } else { groupBoxPrices.Visibility = Visibility.Collapsed; } } }