예제 #1
0
        private void MultiSelectListView_SelectionModeChanged(object sender, RoutedEventArgs e)
        {
            var bar = Bar as CommandBar;

            if (SongList.SelectionMode == ListViewSelectionMode.Multiple)
            {
                HardwareButtons.BackPressed += HardwareButtonsOnBackPressed;
                UiBlockerUtility.BlockNavigation(false);
                SongList.SelectedIndex = -1;

                bar.Visibility = Visibility.Visible;
                SongList.IsItemClickEnabled = false;

                AppBarHelper.SaveState(bar);
                AppBarHelper.SwitchState(bar, _selectionModeCommands, _selectionSecondaryModeCommands);
            }
            else if (!SongList.IsItemClickEnabled)
            {
                HardwareButtons.BackPressed -= HardwareButtonsOnBackPressed;
                UiBlockerUtility.Unblock();
                SongList.IsItemClickEnabled    = true;
                (Bar as CommandBar).Visibility =
                    CollectionPivot.SelectedIndex == 3 ? Visibility.Visible : Visibility.Collapsed;

                AppBarHelper.RestorePreviousState(bar);
            }
        }
예제 #2
0
        private void ToSingleMode()
        {
            UiBlockerUtility.Unblock();
            var bar = Bar as CommandBar;

            SongList.IsItemClickEnabled = true;
            SongList.SelectionMode      = ListViewSelectionMode.None;
            AppBarHelper.RestorePreviousState(bar);
        }