private void sz_Category_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e) { if (!e.IsSourceZoomedInView) { e.DestinationItem.Item = e.SourceItem.Item; } }
/// <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; } }
private void SemanticZoom_OnViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e) { if (TracksZoomedOutView.ItemsSource == null) { TracksZoomedOutView.ItemsSource = GroupTracks.View.CollectionGroups; } }
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 }; }
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); }
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; } }
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; } }
private void sz_FavoritePosts_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e) { if (e.IsSourceZoomedInView) { this.DataContext = null; } e.DestinationItem.Item = e.SourceItem.Item; }
/// <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); } }
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; } }
private void AlbumsByArtistSemanticZoom_OnViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e) { try { Locator.MusicLibraryVM.ExecuteSemanticZoom(); } catch { } }
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); } }
private void SemanticZoom_OnViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e) { if (e.IsSourceZoomedInView) { return; } this.itemGridView.Opacity = 0; }
private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e) { if (e.SourceItem.Item != null) { e.DestinationItem = new SemanticZoomLocation { Item = e.SourceItem.Item }; } }
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(); } }
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); } }
void SemanticZoom_ViewChangeCompleted(object sender, SemanticZoomViewChangedEventArgs e) { if (e.IsSourceZoomedInView) { gridView.SelectedItem = null; } else { //gridView.SelectedItem = e.DestinationItem.Item; } }
private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e) { if (((SemanticZoom)sender).IsZoomedInViewActive) { selectionGrid.Visibility = Visibility.Visible; } else { selectionGrid.Visibility = Visibility.Collapsed; } }
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); } } }
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; } }
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; } } }
/// <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; } }
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; } } }
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; } }
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 }; } } }
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(); } } }