/// <summary> /// An event handler called when the side menu item text has changed. /// </summary> /// <param name="sender">The sender object.</param> /// <param name="e">The event arguments.</param> private void OnItemTextChanged(object sender, SideMenuItemEventArgs e) { // Refresh the item. this.OnRefresh(); }
/// <summary> /// An event handler called when the user clicks on a hidden item. /// </summary> /// <param name="item">The side menu item.</param> private void OnItemHiddenClick(object sender, SideMenuItemEventArgs e) { // Get the index of the menu item. int index = this.items.IndexOf(e.Item); // If the selected index changed. if (this.selectedIndex != index) { // Deselect the currently selected item. if (null != this.selectedIndex) this.items[this.selectedIndex ?? -1].Deselect(); // Change the selected index. this.selectedIndex = index; // Select the currently selected item. this.items[index].Select(); this.OnRefresh(); } }