/// <summary> /// Open the Inventory /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void inventory_button(object sender, RoutedEventArgs e) { //Disable all buttons change_Buttons_Status(false); inventory = null; inventory = new InventoryUC(); room_Canvas.Children.Add(inventory); inventory.Focus(); inventory.Unloaded += UpdateButtonsStartroom; }
private void inventory_button(object sender, RoutedEventArgs e) { inventory = null; inventory = new InventoryUC(); if (Livingroom_Image.Visibility == Visibility.Visible) Livingroom_Image.Children.Add(inventory); else if(Kitchen_Image.Visibility == Visibility.Visible) Kitchen_Image.Children.Add(inventory); else Bedroom_Image.Children.Add(inventory); inventory.Focus(); disable_buttons(); inventory.Unloaded += UpdateButtons; }