public Order() { InitializeComponent(); OrderList orderList = new OrderList(); orderList.orderNum.Content = "Order #1"; orderList.order = this; OrderLists.Children.Add(orderList); resizeSides(); //chefImage.Height = 0; AddOrderButton addOrderButton = new AddOrderButton(); //addOrder.Content = "+ Add Order"; addOrderButton.Button.Click += addOrder_Click; OrderLists.Children.Add(addOrderButton); happyHour = new Image(); Uri uri = new Uri("Images/happyHour.png", UriKind.Relative); happyHour.Source = new BitmapImage(uri); happyHour.TouchDown += goHappyHour; happyHour.MouseLeftButtonUp += goHappyHour; happyHour.MouseDown += goHappyHour; happyHour.MouseLeftButtonDown += goHappyHour; OrderLists.Children.Add(happyHour); }
private void resizeOrder(object sender, SizeChangedEventArgs e) { double third = this.ActualWidth / 3; orderBorder.Padding = new Thickness(this.ActualHeight * 0.05); sendOrdBtn.FontSize = signalBtn.FontSize = this.ActualHeight * 0.03; sendOrdBtn.Margin = new Thickness(this.ActualWidth * 0.05, 0, 0, 0); sendOrdBtn.Width = this.ActualWidth / 3.5; signalBtn.Width = this.ActualWidth / 3; sendOrdBtn.Height = signalBtn.Height = this.ActualHeight * 0.08; for (int j = 0; j < OrderLists.Children.Count; j++) { OrderList orderChild = OrderLists.Children[j] as OrderList; if (orderChild != null) { orderChild.orderNum.FontSize = orderChild.alreadyOrderedLabel.FontSize = orderChild.notOrderedLabel.FontSize = orderChild.total.FontSize = this.ActualHeight * 0.03; orderChild.Height = ActualHeight * 0.7; orderChild.Width = third; } AddOrderButton buttonChild = OrderLists.Children[j] as AddOrderButton; if (buttonChild != null) { buttonChild.Height = ActualHeight * 0.7; buttonChild.Width = third; } Image imageChild = OrderLists.Children[j] as Image; if (imageChild != null) { imageChild.Height = ActualHeight * 0.7; imageChild.Width = third; } } // OrderList orderChild = OrderLists.Children[0] as OrderList; }