Exemplo n.º 1
0
 private void sz_Category_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (!e.IsSourceZoomedInView)
     {
         e.DestinationItem.Item = e.SourceItem.Item;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Event handler for ViewChangeStarted event for SemanticZoom
        /// </summary>
        /// <param name="e">SemanticZoomViewChangedEventArgs</param>
        private void EventHandlerViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            PdfPageViewModel sourceItem = e.SourceItem.Item as PdfPageViewModel;

            if (sourceItem != null)
            {
                int pageIndex = (int)(sourceItem.PageIndex);
                if (this.pdfDataSourceZoomedInView.Count > pageIndex)
                {
                    // Transitioning from Zooomed Out View to Zoomed In View
                    if (this.semanticZoom.IsZoomedInViewActive)
                    {
                        // Getting destination item from Zoomed-In-View
                        PdfPageViewModel destinationItem = (PdfPageViewModel)this.pdfDataSourceZoomedInView[pageIndex];

                        if (destinationItem != null)
                        {
                            e.DestinationItem.Item = destinationItem;
                        }
                    }
                    // Transitioning from Zooomed In View to Zoomed Out View
                    else
                    {
                        // Getting destination item from Zoomed-In-View
                        PdfPageViewModel destinationItem = (PdfPageViewModel)this.pdfDataSourceZoomedOutView[pageIndex];

                        if (destinationItem != null)
                        {
                            e.DestinationItem.Item = destinationItem;
                        }
                    }
                }
            }
        }
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.IsSourceZoomedInView == false)
     {
         e.DestinationItem.Item = e.SourceItem.Item;
     }
 }
Exemplo n.º 4
0
 private void SemanticZoom_OnViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (TracksZoomedOutView.ItemsSource == null)
     {
         TracksZoomedOutView.ItemsSource = GroupTracks.View.CollectionGroups;
     }
 }
Exemplo n.º 5
0
        private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (e.SourceItem == null)
            {
                return;
            }

            if (e.SourceItem.Item.GetType() != typeof(HeaderItem))
            {
                return;
            }

            var hi = (HeaderItem)e.SourceItem.Item;

            var group = OperationGroups.SingleOrDefault(d => ((GroupHeaderByDay)d.Key).DayNum == hi.Day);

            if (group != null)
            {
                e.DestinationItem = new SemanticZoomLocation {
                    Item = group
                }
            }
            ;

            //e.DestinationItem = new SemanticZoomLocation { Item = e.SourceItem.Item };
        }
Exemplo n.º 6
0
        async void OnViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (e.IsSourceZoomedInView)
            {
                return;
            }

            // HACK: Technically more than one short name could be the same, this will potentially find the wrong one in that case
            var item = (string)e.SourceItem.Item;

            var templatedItems = TemplatedItemsView.TemplatedItems;
            int index          = templatedItems.ShortNames.IndexOf(item);

            if (index == -1)
            {
                return;
            }

            var til = templatedItems.GetGroup(index);

            if (til.Count == 0)
            {
                return;                 // FIXME
            }
            // Delay until after the SemanticZoom change _actually_ finishes, fixes tons of odd issues on Phone w/ virtualization.
            if (Device.Idiom == TargetIdiom.Phone)
            {
                await Task.Delay(1);
            }

            IListProxy listProxy = til.ListProxy;

            ScrollTo(listProxy.ProxiedEnumerable, listProxy[0], ScrollToPosition.Start, true, true);
        }
Exemplo n.º 7
0
        private void szListPC_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (e.IsSourceZoomedInView)
            {
                if (AppEnvironment.IsPhone)
                {
                    TopTapGuestureBox.Instance.HideTopTapGuestureUIControl();
                }
                else
                {
                    Messenger.Default.Send <bool>(true, AppMessengerTokenConst.IS_ZOOMSEMANTIC_BUTTON_VISIBLE);
                }

                szPC.ViewChangeStarted   += szPC_ViewChangeStarted;
                szPC.ViewChangeCompleted += szPC_ViewChangeCompleted;
            }
            else
            {
                if (AppEnvironment.IsPhone)
                {
                    TopTapGuestureBox.Instance.ShowTopTapGuestureUIControl();
                }
                else
                {
                    Messenger.Default.Send <bool>(false, AppMessengerTokenConst.IS_ZOOMSEMANTIC_BUTTON_VISIBLE);
                }

                szPC.ViewChangeStarted   -= szPC_ViewChangeStarted;
                szPC.ViewChangeCompleted -= szPC_ViewChangeCompleted;
            }
        }
Exemplo n.º 8
0
        private async void szPC_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (e.IsSourceZoomedInView)
            {
                if (!AppEnvironment.IsPhone)
                {
                    Messenger.Default.Send <bool>(true, AppMessengerTokenConst.IS_ZOOMSEMANTIC_BUTTON_VISIBLE);
                    ViewModelLocator.Instance.VideoFullScreenHandler += VideoFullScreenHandler;
                }

                ViewModelLocator.Instance.VideoVolumeToMuteHandler += VideoVolumeToMuteHandler;

                var model = DicStore.GetValueOrDefault <ModelPropertyBase>(AppCommonConst.CURRENT_SELECTED_ITEM
                                                                           , null);
                if (model != null)
                {
                    this.szPCDailyFlipView.SelectedItem = model;

                    this.videoMediaPlayer.Stop();
                    this.videoMediaPlayer.Source = null;

                    this.videoMediaPlayer.DataContext = model;

                    this.videoMediaPlayer.Volume = SettingsStore.GetValueOrDefault <double>(AppCommonConst.CURRETN_VIDEO_VOLUME_VALUE, 0.5);
                    var playUrl = await CommonHelper.Instance.DecidePlayUrl(model);

                    if (!string.IsNullOrEmpty(playUrl))
                    {
                        this.videoMediaPlayer.Source = new Uri(playUrl, UriKind.RelativeOrAbsolute);
                        this.videoMediaPlayer.Tag    = model.title;
                    }
                    else
                    {
                        await new MessageDialog(AppNetworkMessageConst.VIDEO_URL_IS_ERROR, "提示").ShowAsyncQueue();

                        szPC.IsZoomedInViewActive = true;
                    }
                }

                //this.videoMediaPlayer.Play();

                //var ctrl = CoreVisualTreeHelper.Instance.FindVisualChildByName<Control>(this.videoMediaPlayer, "pro");
            }
            else
            {
                if (!AppEnvironment.IsPhone)
                {
                    Messenger.Default.Send <bool>(false, AppMessengerTokenConst.IS_ZOOMSEMANTIC_BUTTON_VISIBLE);
                    appBarFullScreenBtn = null;
                    ViewModelLocator.Instance.VideoFullScreenHandler -= VideoFullScreenHandler;
                }

                appBarVolumeBtn = null;
                ViewModelLocator.Instance.VideoVolumeToMuteHandler -= VideoVolumeToMuteHandler;

                this.videoMediaPlayer.Stop();
                this.videoMediaPlayer.Source = null;
            }
        }
Exemplo n.º 9
0
 private void sz_FavoritePosts_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.IsSourceZoomedInView)
     {
         this.DataContext = null;
     }
     e.DestinationItem.Item = e.SourceItem.Item;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Zooms to approipate header when Header selected from Semantic Out view.
 /// </summary>
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.IsSourceZoomedInView == false)
     {
         var sourceItem = e.SourceItem.Item as BindableGuildMemberGroup;
         e.DestinationItem.Item = ViewModel.CurrentBindableMembers.FirstOrDefault(x => x is BindableGuildMemberGroup group && group.Model.Id == sourceItem.Model.Id);
     }
 }
Exemplo n.º 11
0
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     // We need to synchronize the two lists (zoomed-in and zoomed-out) because the source is different
     if (!e.IsSourceZoomedInView)
     {
         e.DestinationItem.Item = e.SourceItem.Item;
     }
 }
Exemplo n.º 12
0
 private void AlbumsByArtistSemanticZoom_OnViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     try
     {
         Locator.MusicLibraryVM.ExecuteSemanticZoom();
     }
     catch { }
 }
Exemplo n.º 13
0
 private void sz_AuthorPosts_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (!e.IsSourceZoomedInView & isZoomOutTapped)
     {
         Post post = e.DestinationItem.Item as Post;
         isZoomOutTapped = false;
         this.Frame.Navigate(typeof(Pages.ReadingPage), post);
     }
 }
Exemplo n.º 14
0
        private void SemanticZoom_OnViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (e.IsSourceZoomedInView)
            {
                return;
            }

            this.itemGridView.Opacity = 0;
        }
Exemplo n.º 15
0
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.SourceItem.Item != null)
     {
         e.DestinationItem = new SemanticZoomLocation {
             Item = e.SourceItem.Item
         };
     }
 }
Exemplo n.º 16
0
 private void sz_News_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (!e.IsSourceZoomedInView & isZoomOutTapped)
     {
         News news = e.DestinationItem.Item as News;
         isZoomOutTapped = false;
         this.Frame.Navigate(typeof(NewsReadingPage), news);
         sz_News.ToggleActiveView();
     }
 }
Exemplo n.º 17
0
        private void SemanticZoom_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            var zoom = sender as SemanticZoom;

            if (zoom.IsZoomedInViewActive)
            {
                var scroller = AlbumList.GetScrollViewer();
                scroller.ChangeView(null, scroller.VerticalOffset - 120, null);
            }
        }
Exemplo n.º 18
0
 void SemanticZoom_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.IsSourceZoomedInView)
     {
         gridView.SelectedItem = null;
     }
     else
     {
         //gridView.SelectedItem = e.DestinationItem.Item;
     }
 }
Exemplo n.º 19
0
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (((SemanticZoom)sender).IsZoomedInViewActive)
     {
         selectionGrid.Visibility = Visibility.Visible;
     }
     else
     {
         selectionGrid.Visibility = Visibility.Collapsed;
     }
 }
Exemplo n.º 20
0
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.IsSourceZoomedInView)
     {
         MainGridView.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
     }
     else
     {
         MainGridView.Visibility = Windows.UI.Xaml.Visibility.Visible;
     }
 }
 /// <summary>
 ///		Invoked when the Zoom on the <see cref="SemanticZoom"/> control has been changed.
 /// </summary>
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (!e.IsSourceZoomedInView)
     {
         var selectedGroupFirst = (e.SourceItem.Item as IconFontCollectionGroup)?.Items?.First();
         if ((IconFontCollectionGridView.Items?.Any() ?? false) && selectedGroupFirst != null)
         {
             IconFontCollectionGridView.SelectedItem = selectedGroupFirst;
             IconFontCollectionGridView.ScrollIntoView(selectedGroupFirst);
         }
     }
 }
 /// <summary>
 ///		セマンティックズームコントロールのズームが変更された時に実行されます。
 /// </summary>
 private void SpacomicSemantics_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (!e.IsSourceZoomedInView)
     {
         var selectedGroupFirst = (e.SourceItem.Item as SpacomicRSSItemsGroup)?.Items?.First();
         if ((SpacomicRSSList.Items?.Any() ?? false) && selectedGroupFirst != null)
         {
             SpacomicRSSList.SelectedItem = selectedGroupFirst;
             SpacomicRSSList.ScrollIntoView(selectedGroupFirst);
         }
     }
 }
Exemplo n.º 23
0
        private async void szPC_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (e.IsSourceZoomedInView)
            {
                if (!AppEnvironment.IsPhone)
                {
                    ViewModelLocator.Instance.VideoFullScreenHandler += VideoFullScreenHandler;
                }

                ViewModelLocator.Instance.VideoVolumeToMuteHandler += VideoVolumeToMuteHandler;

                var model = DicStore.GetValueOrDefault <ModelPropertyBase>(AppCommonConst.CURRENT_SELECTED_ITEM
                                                                           , null);
                if (model != null)
                {
                    this.szCategoryDetailFlipView.SelectedItem = model;

                    this.videoMediaPlayer.Stop();
                    this.videoMediaPlayer.Source = null;

                    this.videoMediaPlayer.DataContext = model;
                    this.videoMediaPlayer.Volume      = SettingsStore.GetValueOrDefault <double>(AppCommonConst.CURRETN_VIDEO_VOLUME_VALUE, 0.5);
                    var playUrl = await CommonHelper.Instance.DecidePlayUrl(model);

                    if (!string.IsNullOrEmpty(playUrl))
                    {
                        this.videoMediaPlayer.Source = new Uri(playUrl, UriKind.RelativeOrAbsolute);
                    }
                    else
                    {
                        await new MessageDialog(AppNetworkMessageConst.VIDEO_URL_IS_ERROR, "提示").ShowAsyncQueue();

                        szPC.IsZoomedInViewActive = true;
                    }
                }

                //this.videoMediaPlayer.Play();
            }
            else
            {
                if (!AppEnvironment.IsPhone)
                {
                    appBarFullScreenBtn = null;
                    ViewModelLocator.Instance.VideoFullScreenHandler -= VideoFullScreenHandler;
                }

                appBarVolumeBtn = null;
                ViewModelLocator.Instance.VideoVolumeToMuteHandler -= VideoVolumeToMuteHandler;

                this.videoMediaPlayer.Stop();
                this.videoMediaPlayer.Source = null;
            }
        }
Exemplo n.º 24
0
 private void szListPC_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.IsSourceZoomedInView)
     {
         var model = DicStore.GetValueOrDefault <ModelPropertyBase>(AppCommonConst.CURRENT_SELECTED_ITEM
                                                                    , null);
         if (model != null)
         {
             this.szCategoryDetailFlipView.SelectedItem = model;
         }
     }
 }
Exemplo n.º 25
0
        /// <summary>
        /// This method is called on toggling between the Zoomed In/Out views.
        /// It helps to zoom to the correct section of the hub control.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SemanticZoom_OnViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            //Only check for zoomed out view
            if (e.IsSourceZoomedInView == false)
            {
                //Get the index of the source item
                int        index = ZoomedOutGrid.Items.IndexOf(e.SourceItem.Item);
                HubSection item  = NormalHub.Sections[index];

                //Make the scroll destination to point selected hub section
                e.DestinationItem.Item = item;
            }
        }
Exemplo n.º 26
0
 private void szPC_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (AppEnvironment.IsPhone)
     {
         if (e.IsSourceZoomedInView)
         {
             Messenger.Default.Send <bool>(true, AppMessengerTokenConst.IS_PHONE_VIDEO_SHOW);
             DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
         }
         else
         {
             Messenger.Default.Send <bool>(false, AppMessengerTokenConst.IS_PHONE_VIDEO_SHOW);
             DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;
         }
     }
 }
Exemplo n.º 27
0
        private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (!e.IsSourceZoomedInView)
            {
                var semantic = sender as SemanticZoom;
                var view1    = semantic.ZoomedInView as GridView;
                var view2    = semantic.ZoomedOutView as GridView;
                var index    = view2.Items.IndexOf(e.SourceItem.Item);
                e.DestinationItem.Item = view1.Items[index];

                Ad.Visibility = Visibility.Visible;
            }
            else
            {
                Ad.Visibility = Visibility.Collapsed;
            }
        }
Exemplo n.º 28
0
        private void szListPC_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
        {
            if (e.IsSourceZoomedInView)
            {
                Messenger.Default.Send <bool>(true, AppMessengerTokenConst.IS_DOWNLOAD_FLIPVIEW_SHOW);

                var model = DicStore.GetValueOrDefault <ModelPropertyBase>(AppCommonConst.CURRENT_SELECTED_ITEM
                                                                           , null);
                if (model != null)
                {
                    this.szDownloadFlipView.SelectedItem = model;
                }
            }
            else
            {
                Messenger.Default.Send <bool>(false, AppMessengerTokenConst.IS_DOWNLOAD_FLIPVIEW_SHOW);
            }
        }
 private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.SourceItem == null || e.SourceItem.Item == null)
     {
         return;
     }
     if (e.SourceItem.Item.GetType() == typeof(HeaderItem))
     {
         HeaderItem headerItem = (HeaderItem)e.SourceItem.Item;
         var        group      = _dataLetter.First(d => ((char)d.Key) == headerItem.HeaderName);
         if (group != null)
         {
             e.DestinationItem = new SemanticZoomLocation {
                 Item = group
             };
         }
     }
 }
Exemplo n.º 30
0
 private void SemanticZoom_OnViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
 {
     if (e.IsSourceZoomedInView)
     {
         var groups = this.ListViewGroups.ItemsSource as IEnumerable <PlaylistsGroupBindingModel>;
         if (groups != null)
         {
             e.DestinationItem.Item = groups.FirstOrDefault(x => x.Playlists.Contains(e.SourceItem.Item));
         }
     }
     else
     {
         var group = e.SourceItem.Item as PlaylistsGroupBindingModel;
         if (group != null)
         {
             e.DestinationItem.Item = group.Playlists.FirstOrDefault();
         }
     }
 }