//Animation Methods public void BlueGridMethod() { DoubleAnimation db = new DoubleAnimation { From = 0, To = 1196, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; BlueGrid.BeginAnimation(WidthProperty, db); }
private void StateComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { switch (StateComboBox.SelectedIndex) { case 0: ResetAlignment(); break; case 1: // Align Right ResetAlignment(); RedGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); BlueGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); GreenGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); RedGrid.SetValue(RelativePanel.AlignRightWithPanelProperty, true); BlueGrid.SetValue(RelativePanel.AlignRightWithPanelProperty, true); GreenGrid.SetValue(RelativePanel.AlignRightWithPanelProperty, true); break; case 2: // Align to Each Other ResetAlignment(); RedGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); BlueGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); GreenGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); RedGrid.SetValue(RelativePanel.AlignRightWithProperty, GreenGrid); BlueGrid.SetValue(RelativePanel.AlignRightWithProperty, GreenGrid); break; case 3: // Relative to Each Other ResetAlignment(); BlueGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); GreenGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); BlueGrid.SetValue(RelativePanel.RightOfProperty, RedGrid); GreenGrid.SetValue(RelativePanel.RightOfProperty, BlueGrid); break; case 4: // Complex ResetAlignment(); RedGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); BlueGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); GreenGrid.SetValue(RelativePanel.AlignLeftWithPanelProperty, false); RedGrid.SetValue(RelativePanel.AlignTopWithPanelProperty, false); BlueGrid.SetValue(RelativePanel.AlignTopWithPanelProperty, false); GreenGrid.SetValue(RelativePanel.AlignTopWithPanelProperty, false); RedGrid.SetValue(RelativePanel.AlignHorizontalCenterWithPanelProperty, true); RedGrid.SetValue(RelativePanel.AlignVerticalCenterWithPanelProperty, true); BlueGrid.SetValue(RelativePanel.RightOfProperty, RedGrid); BlueGrid.SetValue(RelativePanel.BelowProperty, RedGrid); GreenGrid.SetValue(RelativePanel.LeftOfProperty, RedGrid); GreenGrid.SetValue(RelativePanel.AboveProperty, RedGrid); break; } }