private void CloseBtn_Click(object sender, RoutedEventArgs e) { SecondStack.SetValue(Grid.ColumnProperty, 1); SecondStack.SetValue(Grid.ColumnSpanProperty, 1); FirstStack.SetValue(Grid.ColumnSpanProperty, 1); FirstStack.Visibility = Visibility.Visible; SecondStack.Visibility = Visibility.Visible; DetailSplitView.IsPaneOpen = false; }
/// <summary> /// 1つ目のStackから2つ目のStackへの移動処理を行う /// </summary> private void MoveCheck() { if (SecondStack.Count == 0) { while (FirstStack.Count > 0) { SecondStack.Push(FirstStack.Pop()); } } }
/// <summary> /// extracts a value from the PseudoQueue, using a first-in, first-out approach. /// </summary> /// <param name="value"></param> public int PseudoQueueDequeue() { if (FirstStack.IsEmpty()) { throw new Exception("Nothing in PsuedoQueue"); } while (FirstStack.Top.Next != null) { SecondStack.Push(FirstStack.Pop()); } int dequeuedValue = FirstStack.Pop(); while (!SecondStack.IsEmpty()) { FirstStack.Push(SecondStack.Pop()); } return(dequeuedValue); }
/// <summary> /// inserts value into the PseudoQueue, using a first-in, first-out approach. /// </summary> /// <param name="value"></param> public void PseudoQueueEnqueue(int value) { if (FirstStack.IsEmpty()) { FirstStack.Push(value); } else { while (!FirstStack.IsEmpty()) { SecondStack.Push(FirstStack.Pop()); } FirstStack.Push(value); while (!SecondStack.IsEmpty()) { FirstStack.Push(SecondStack.Pop()); } } }
private async void DoctorGrid_ItemClick(object sender, ItemClickEventArgs e) { //Frame parentFrame = Window.Current.Content as Frame; //MainPage mp = parentFrame.Content as MainPage; //StackPanel grid = mp.Content as StackPanel; //Frame my_frame = grid.FindName("myFrame") as Frame; DetailSplitView.IsPaneOpen = true; SecondStack.Visibility = Visibility.Collapsed; FirstStack.SetValue(Grid.ColumnSpanProperty, 2); await viewModel.AddDocSearchResult(new Doc_Search() { doc_id = (e.ClickedItem as Doctor).ID, user_id = 1 }); HospDocFrame.Navigate(typeof(SelectedDocDetailView), new DocNavEventArgs() { val = (e.ClickedItem as Doctor).ID, view = this, mainPage = mp } , new SuppressNavigationTransitionInfo()); HospDocFrame.BackStack.Clear(); }