/// <summary> /// Inserts a new element behind the CurrentElement and moves the CurrentElement to the /// new element. /// This method removes all elements which came after CurrentElement and leaves /// the inserted element as the new end of the list. /// </summary> /// <param name="element">Element to insert.</param> public void AddAtCurrentElementDeleteBehind(T element) { if (CurrentElement == null) { CurrentElement = new HistoryListElement <T>(null, null, element); } else { CurrentElement.Next = new HistoryListElement <T>(null, CurrentElement, element); this.Forward(); } }
/// <summary> /// Hides the CllickedRect of the previous element if it was set and shows it on the /// CurrentElement of the HistoryList. /// If the button is set as the PreviousElement in the HistoryList the animation /// is not played by omitting to set the ClickedRect to hidden. /// </summary> private void UpdateClickRect() { if (!viewModel.NavigationHistory.IsRepeatedElement()) { HistoryListElement <PageItem> previousElement = viewModel.NavigationHistory.PreviousElement; if (previousElement != null && previousElement.Element.MenuButton != null) { previousElement.Element.MenuButton.ClickedRectVisibility = Visibility.Hidden; } } HistoryListElement <PageItem> currentElement = viewModel.NavigationHistory.CurrentElement; if (currentElement != null && currentElement.Element.MenuButton != null) { currentElement.Element.MenuButton.ClickedRectVisibility = Visibility.Visible; } }
/// <summary> /// Creates an empty HistoryList with CurrentElement and PreviousElement set /// to null. /// </summary> public HistoryList() { CurrentElement = null; PreviousElement = null; }