Beispiel #1
0
        /// <summary>
        /// Handles changes in edited components (hides/shows side menu when necessary)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnEditedComponentChanged(object sender, EditedComponentChangedEventArgs args)
        {
            switch (args.Change)
            {
            case EditedComponentChanged.NullToComponent:
            case EditedComponentChanged.NoChange:
            case EditedComponentChanged.ComponentToComponent:
            {
                // Show the edit menu if it wasn't shown
                if (SideMenu.GetSelectedContentIndex() != 1)
                {
                    SideMenu.SetSelectedContentFromIndex(1);
                }

                SideMenu.IsOpen = true;
            }
            break;

            case EditedComponentChanged.ComponentToNull:
            {
                // Hide the menu
                SideMenu.IsOpen = false;
            }
            break;
            }
        }