Exemplo n.º 1
0
        private void FileList_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            var BoxPressed = Interaction.FindParent <GridViewItem>(e.OriginalSource as DependencyObject);

            if (BoxPressed == null)
            {
                gv.SelectedItems.Clear();
            }
        }
Exemplo n.º 2
0
        private void StackPanel_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            var parentContainer = Interaction.FindParent <GridViewItem>(e.OriginalSource as DependencyObject);

            foreach (ListedItem listedItem in FileList.SelectedItems)
            {
                if (FileList.IndexFromContainer(parentContainer) == listedItem.RowIndex)
                {
                    return;
                }
            }
            // The following code is only reachable when a user RightTapped an unselected row
            FileList.SelectedItems.Clear();
            FileList.SelectedItems.Add(FileList.ItemFromContainer(parentContainer) as ListedItem);
        }