private void UnCollapseUi() { IsCollapse = false; DoubleAnimation anim = new DoubleAnimation(); anim.From = CurrentRoomBox.Height; anim.To = CurrentRoomBox.MaxHeight; anim.Duration = new Duration(TimeSpan.FromMilliseconds(ANIM_SPEED)); CurrentRoomBox.BeginAnimation(Border.HeightProperty, anim); anim.From = RoomListBox.Height; anim.To = 230; RoomListBox.BeginAnimation(Border.HeightProperty, anim); }
private void CollapseUi() { IsCollapse = true; //Свернуть box текущей комнаты DoubleAnimation anim = new DoubleAnimation(); anim.From = CurrentRoomBox.Height; anim.To = 60; anim.Duration = new Duration(TimeSpan.FromMilliseconds(ANIM_SPEED)); CurrentRoomBox.BeginAnimation(Border.HeightProperty, anim); anim.From = RoomListBox.Height; anim.To = RoomListBox.MaxHeight - 90; RoomListBox.BeginAnimation(Border.HeightProperty, anim); }
private void CloseUi() { if (IsOpen) { IsOpen = false; CurrentRoomBox.IsEnabled = false; DoubleAnimation anim = new DoubleAnimation(); anim.From = CurrentRoomBox.Height; anim.To = 0; anim.Duration = new Duration(TimeSpan.FromMilliseconds(ANIM_SPEED)); CurrentRoomBox.BeginAnimation(Border.HeightProperty, anim); anim.From = RoomListBox.Height; anim.To = RoomListBox.MaxHeight; RoomListBox.BeginAnimation(Border.HeightProperty, anim); } }