Esempio n. 1
0
        /// <summary>
        /// Handles the CloseRequested event of any RiverItems inside of a ItemProxy. Returns the item to the river
        /// when a close button is tapped.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void ScatterViewItem_CloseRequested(object sender, UserSourceRoutedEventArgs e)
        {
            ScatterViewItem svi = _scatterView.ContainerFromElement(sender as FrameworkElement) as ScatterViewItem;
            SurfaceButton button = e.UserSource as SurfaceButton;

            if (button == null && svi.AreAnyTouchesCapturedWithin)
            {
                // Don't respond if any contact is captured.
                return;
            }

            if (button != null && svi.TouchesCapturedWithin.Where(c => !button.TouchesCapturedWithin.Contains(c)).Count() > 0)
            {
                // If the only contacts captured are within the source object, it's ok to respond.
                return;
            }

            ReturnItemProxyToRiver(svi);
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the FlipRequested event of the ItemProxy control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void ScatterViewItem_FlipRequested(object sender, UserSourceRoutedEventArgs e)
        {
            ScatterViewItem svi = _scatterView.ContainerFromElement(sender as FrameworkElement) as ScatterViewItem;
            SurfaceButton button = e.UserSource as SurfaceButton;

            if (button == null && svi.AreAnyTouchesCapturedWithin)
            {
                // Don't respond if any contact is captured.
                return;
            }

            if (button != null && svi.TouchesCapturedWithin.Where(c => !button.TouchesCapturedWithin.Contains(c)).Count() > 0)
            {
                // If the only contacts captured are within the source object, it's ok to respond.
                return;
            }

            Audio.Instance.PlayCue("streamItem_flip");
            ScatterFlip.SetIsFlipped(svi, !ScatterFlip.GetIsFlipped(svi));
            BeginIdleTimeout(svi);
        }