Exemple #1
0
    private void Navigation_FocusedChanged(UIDataViewList dataViewList)
    {
        // Clear the buttons displayed at the bottom of the UI.
        ControlList.Clear();

        // Select the first item when the Items list is focused.
        if (dataViewList == Items)
        {
            // Mark the currently highlighted category as Selected.
            categoriesDataView.Select();

            // If the same category is selected, leave the highlighted view alone.
            if (categoriesDataView.CurrentData.CategoryType != selectedCategory)
            {
                // Otherwise highlight the first item.
                itemsDataView.ResetAll();
                itemsDataView.MoveToStart();
                itemsDataView.Highlight();
            }

            // Display controls.
            ControlList.AddControl(new ControlData(InputAction.Equip, "Equip"));
            ControlList.AddControl(new ControlData(InputAction.Drop, "Drop"));
        }

        if (dataViewList == Categories)
        {
            categoriesDataView.Highlight();
        }
    }