public void SetVerticalOffset(double offset) { if (RootScrollViewer != null) { RootScrollViewer.ChangeView(default(double?), offset, default(float?)); } }
private void itemListView_ItemClick(object sender, ItemClickEventArgs e) { RootScrollViewer.ChangeView(0, 0, 1); Entry v = ((Entry)e.ClickedItem); SetVideo(v); }
private void OnWebViewPointerWheelChanged(object sender, PointerRoutedEventArgs e) { if (sender is UIElement webContent) { e.GetIntermediatePoints(webContent); if (!e.GetCurrentPoint(this).Properties.IsHorizontalMouseWheel) { var verticalOffset = RootScrollViewer.VerticalOffset - e.GetCurrentPoint(webContent).Properties.MouseWheelDelta; RootScrollViewer.ChangeView(RootScrollViewer.HorizontalOffset, verticalOffset, RootScrollViewer.ZoomFactor); } } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "科技"; if (e.NavigationMode == NavigationMode.Back) { ToolEntranceTransition.FromVerticalOffset = 0; LightEntranceTransition.FromVerticalOffset = 0; NauticalEntranceTransition.FromVerticalOffset = 0; SurvivalEntranceTransition.FromVerticalOffset = 0; FoodEntranceTransition.FromVerticalOffset = 0; TechnologyEntranceTransition.FromVerticalOffset = 0; FightEntranceTransition.FromVerticalOffset = 0; StructureEntranceTransition.FromVerticalOffset = 0; RefineEntranceTransition.FromVerticalOffset = 0; MagicEntranceTransition.FromVerticalOffset = 0; DressEntranceTransition.FromVerticalOffset = 0; AncientEntranceTransition.FromVerticalOffset = 0; BookEntranceTransition.FromVerticalOffset = 0; ShadowEntranceTransition.FromVerticalOffset = 0; CritterEntranceTransition.FromVerticalOffset = 0; SculptEntranceTransition.FromVerticalOffset = 0; CartographyEntranceTransition.FromVerticalOffset = 0; OfferingsEntranceTransition.FromVerticalOffset = 0; VolcanoEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var extraData = (ViewExtraData)e.Parameter; await Deserialize(); if (extraData != null) { if (extraData.ExpandedList != null) { //展开之前展开的Expander for (var i = 0; i < extraData.ExpandedList.Count; i++) { ((Expander)RootStackPanel.Children[i]).IsExPanded = extraData.ExpandedList[i] == "True"; } } //ScrollViewer滚动到指定位置 RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, extraData.ScrollViewerVerticalOffset, null, true); //导航到指定页面 var _e = extraData.Picture; switch (extraData.Classify) { case "ScienceTool": ToolExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceToolGridView, _scienceToolData, _e); break; case "ScienceLight": LightExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceLightGridView, _scienceLightData, _e); break; case "ScienceNautical": NauticalExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceNauticalGridView, _scienceNauticalData, _e); break; case "ScienceSurvival": SurvivalExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceSurvivalGridView, _scienceSurvivalData, _e); break; case "ScienceFood": FoodExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceFoodGridView, _scienceFoodData, _e); break; case "ScienceTechnology": TechnologyExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceTechnologyGridView, _scienceTechnologyData, _e); break; case "ScienceFight": FightExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceFightGridView, _scienceFightData, _e); break; case "ScienceStructure": StructuresExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceStructureGridView, _scienceStructureData, _e); break; case "ScienceRefine": RefineExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceRefineGridView, _scienceRefineData, _e); break; case "ScienceMagic": MagicExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceMagicGridView, _scienceMagicData, _e); break; case "ScienceDress": DressExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceDressGridView, _scienceDressData, _e); break; case "ScienceAncient": AncientExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceAncientGridView, _scienceAncientData, _e); break; case "ScienceBook": BooksExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceBookGridView, _scienceBookData, _e); break; case "ScienceShadow": ShadowExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceShadowGridView, _scienceShadowData, _e); break; case "ScienceCritter": CritterExpaner.IsExPanded = true; OnNavigatedToScienceDialog(ScienceCritterGridView, _scienceCritterData, _e); break; case "ScienceSculpt": SculptExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceSculptGridView, _scienceSculptData, _e); break; case "ScienceCartography": CartographyExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceCartographyGridView, _scienceCartographyData, _e); break; case "ScienceOfferings": OfferingsExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceOfferingsGridView, _scienceOfferingsData, _e); break; case "ScienceVolcano": VolcanoExpander.IsExPanded = true; OnNavigatedToScienceDialog(ScienceVolcanoGridView, _scienceVolcanoData, _e); break; } } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "物品"; if (e.NavigationMode == NavigationMode.Back) { MaterialEntranceTransition.FromVerticalOffset = 0; EquipmentEntranceTransition.FromVerticalOffset = 0; SaplingEntranceTransition.FromVerticalOffset = 0; CreaturesEntranceTransition.FromVerticalOffset = 0; TrinketsEntranceTransition.FromVerticalOffset = 0; TurfEntranceTransition.FromVerticalOffset = 0; PetEntranceTransition.FromVerticalOffset = 0; UnlockEntranceTransition.FromVerticalOffset = 0; HallowedNightsEntranceTransition.FromVerticalOffset = 0; WintersFeastEntranceTransition.FromVerticalOffset = 0; YearOfTheGobblerEntranceTransition.FromVerticalOffset = 0; ComponentEntranceTransition.FromVerticalOffset = 0; OthersEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var extraData = (ViewExtraData)e.Parameter; await Deserialize(); if (extraData != null) { if (extraData.ExpandedList != null) { //展开之前展开的Expander for (var i = 0; i < extraData.ExpandedList.Count; i++) { ((Expander)RootStackPanel.Children[i]).IsExPanded = extraData.ExpandedList[i] == "True"; } } //ScrollViewer滚动到指定位置 RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, extraData.ScrollViewerVerticalOffset, null, true); //导航到指定页面 var _e = extraData.Picture; switch (extraData.Classify) { case "GoodMaterial": MaterialExpander.IsExPanded = true; OnNavigatedToGoodMaterialDialog(_e); break; case "GoodEquipment": EquipmentExpander.IsExPanded = true; OnNavigatedToGoodEquipmentDialog(_e); break; case "GoodSapling": SaplingExpander.IsExPanded = true; OnNavigatedToGoodSaplingDialog(_e); break; case "GoodCreatures": CreaturesExpander.IsExPanded = true; OnNavigatedToGoodCreaturesDialog(_e); break; case "GoodTrinkets": TrinketsExpander.IsExPanded = true; OnNavigatedToGoodDialog(GoodTrinketsGridView, _goodTrinketsData, _e); break; case "GoodTurf": TurfExpander.IsExPanded = true; OnNavigatedToGoodTurfDialog(_e); break; case "GoodPet": PetExpander.IsExPanded = true; OnNavigatedToGoodPetDialog(_e); break; case "GoodUnlock": UnlockExpander.IsExPanded = true; OnNavigatedToGoodUnlockDialog(_e); break; case "GoodHallowedNights": HallowedNightsExpander.IsExPanded = true; OnNavigatedToGoodDialog(GoodHallowedNightsGridView, _goodHallowedNightsData, _e); break; case "GoodWintersFeast": WintersFeastExpander.IsExPanded = true; OnNavigatedToGoodDialog(GoodWintersFeastGridView, _goodWintersFeastData, _e); break; case "GoodYearOfTheGobbler": YearOfTheGobblerExpander.IsExPanded = true; OnNavigatedToGoodDialog(GoodYearOfTheGobblerGridView, _goodYearOfTheGobblerData, _e); break; case "GoodComponent": ComponentExpander.IsExPanded = true; OnNavigatedToGoodDialog(GoodComponentGridView, _goodComponentData, _e); break; case "GoodOthers": GoodOthersExpander.IsExPanded = true; OnNavigatedToGoodDialog(GoodOthersGridView, _goodOthersData, _e); break; } } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "生物"; if (e.NavigationMode == NavigationMode.Back) { LandEntranceTransition.FromVerticalOffset = 0; OceanEntranceTransition.FromVerticalOffset = 0; FlyEntranceTransition.FromVerticalOffset = 0; CaveEntranceTransition.FromVerticalOffset = 0; EvilEntranceTransition.FromVerticalOffset = 0; OthersEntranceTransition.FromVerticalOffset = 0; BossEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var parameter = (List <string>)e.Parameter; await Deserialize(); if (parameter == null || parameter.Count == 0) { return; } if (parameter.Count > 3) { //展开之前展开的Expander for (var i = 3; i < parameter.Count; i++) { ((Expander)RootStackPanel.Children[i - 3]).IsExPanded = parameter[i] == "True"; } //ScrollViewer滚动到指定位置 if (!string.IsNullOrEmpty(parameter[2])) { RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, double.Parse(parameter[2]), null, true); } } //导航到指定页面 var _e = parameter[1]; switch (parameter[0]) { case "CreatureLand": LandExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureLandGridView, _creatureLandData, _e); break; case "CreatureOcean": OceanExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureOceanGridView, _creatureOceanData, _e); break; case "CreatureFly": FlyExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureFlyGridView, _creatureFlyData, _e); break; case "CreatureCave": CaveExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureCaveGridView, _creatureCaveData, _e); break; case "CreatureEvil": EvilExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureEvilGridView, _creatureEvilData, _e); break; case "CreatureOther": OthersExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureOthersGridView, _creatureOthersData, _e); break; case "CreatureBoss": BossExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureBossGridView, _creatureBossData, _e); break; } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "食物"; if (e.NavigationMode == NavigationMode.Back) { RecipeEntranceTransition.FromVerticalOffset = 0; MeatEntranceTransition.FromVerticalOffset = 0; VegetableEntranceTransition.FromVerticalOffset = 0; FruitEntranceTransition.FromVerticalOffset = 0; EggEntranceTransition.FromVerticalOffset = 0; OtherEntranceTransition.FromVerticalOffset = 0; NoFcEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var extraData = (ViewExtraData)e.Parameter; await Deserialize(); if (extraData != null) { if (extraData.ExpandedList != null) { //展开之前展开的Expander for (var i = 0; i < extraData.ExpandedList.Count; i++) { ((Expander)RootStackPanel.Children[i]).IsExPanded = extraData.ExpandedList[i] == "True"; } } //ScrollViewer滚动到指定位置 RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, extraData.ScrollViewerVerticalOffset, null, true); //导航到指定页面 var _e = extraData.Picture; switch (extraData.Classify) { case "FoodRecipe": RecipesExpander.IsExPanded = true; OnNavigatedToFoodRecipeDialog(_e); break; case "FoodMeats": MeatsExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodMeatGridView, _foodMeatData, _e); break; case "FoodVegetables": VegetablesExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodVegetableGridView, _foodVegetableData, _e); break; case "FoodFruits": FruitsExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodFruitGridView, _foodFruitData, _e); break; case "FoodEggs": EggsExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodEggGridView, _foodEggData, _e); break; case "FoodOthers": OtherExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodOtherGridView, _foodOtherData, _e); break; case "FoodNoFc": NoFcExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodNoFcGridView, _foodNoFcData, _e); break; } } }
public async void BringIntoViewLastIntractItem() { var pageVM = (DataContext as FolderListupPageViewModel); var lastIntaractItem = pageVM.FolderLastIntractItem.Value; if (lastIntaractItem != null) { DependencyObject item; do { item = FoldersAdaptiveGridView.ContainerFromItem(lastIntaractItem); await Task.Delay(10); }while (item == null); if (item is Control control) { var transform = control.TransformToVisual(RootScrollViewer); var positionInScrollViewer = transform.TransformPoint(new Point(0, 0)); RootScrollViewer.ChangeView(null, positionInScrollViewer.Y, null, true); control.Focus(FocusState.Keyboard); } } else if (pageVM.ImageLastIntractItem.Value >= 1) { // 実際にスクロールするまでItemTemplateは解決されない // 一旦Opacity=0.0に設定した上で要素が取れるまでプログラマチックにスクロールしていく // 要素が取れてスクロールが完了したらOpacity=1.0に戻す /* * DependencyObject item; * var visibleItemsRepeater = new[] { FileItemsRepeater_Line, FileItemsRepeater_Small, FileItemsRepeater_Midium, FileItemsRepeater_Large }.First(x => x.Visibility == Visibility.Visible); * visibleItemsRepeater.Opacity = 0.0; * RootScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden; * double offset = 0; * { * var transform = visibleItemsRepeater.TransformToVisual(RootScrollViewer); * var positionInScrollViewer = transform.TransformPoint(new Point(0, 0)); * RootScrollViewer.ChangeView(null, positionInScrollViewer.Y, null, true); * offset = positionInScrollViewer.Y; * } * * do * { * item = visibleItemsRepeater.TryGetElement(pageVM.ImageLastIntractItem.Value); * * RootScrollViewer.ChangeView(null, offset, null, true); * * offset += RootScrollViewer.ViewportHeight; * * await Task.Delay(10); * } * while (item == null); * * await Task.Delay(100); * * if (item is Control control) * { * var transform = control.TransformToVisual(RootScrollViewer); * var positionInScrollViewer = transform.TransformPoint(new Point(0, 0)); * control.Focus(FocusState.Keyboard); * RootScrollViewer.StartBringIntoView(new BringIntoViewOptions() { AnimationDesired = false }); * // RootScrollViewer.ChangeView(null, positionInScrollViewer.Y, null, true); * } * * visibleItemsRepeater.Opacity = 1.0; * RootScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Visible; */ } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "生物"; if (e.NavigationMode == NavigationMode.Back) { LandEntranceTransition.FromVerticalOffset = 0; OceanEntranceTransition.FromVerticalOffset = 0; FlyEntranceTransition.FromVerticalOffset = 0; CaveEntranceTransition.FromVerticalOffset = 0; EvilEntranceTransition.FromVerticalOffset = 0; OthersEntranceTransition.FromVerticalOffset = 0; BossEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var extraData = (ViewExtraData)e.Parameter; await Deserialize(); if (extraData != null) { if (extraData.ExpandedList != null) { //展开之前展开的Expander for (var i = 0; i < extraData.ExpandedList.Count; i++) { ((Expander)RootStackPanel.Children[i]).IsExPanded = extraData.ExpandedList[i] == "True"; } } //ScrollViewer滚动到指定位置 RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, extraData.ScrollViewerVerticalOffset, null, true); //导航到指定页面 var _e = extraData.Picture; switch (extraData.Classify) { case "CreatureLand": LandExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureLandGridView, _creatureLandData, _e); break; case "CreatureOcean": OceanExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureOceanGridView, _creatureOceanData, _e); break; case "CreatureFly": FlyExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureFlyGridView, _creatureFlyData, _e); break; case "CreatureCave": CaveExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureCaveGridView, _creatureCaveData, _e); break; case "CreatureEvil": EvilExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureEvilGridView, _creatureEvilData, _e); break; case "CreatureOther": OthersExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureOthersGridView, _creatureOthersData, _e); break; case "CreatureBoss": BossExpander.IsExPanded = true; OnNavigatedToCreatureDialog(CreatureBossGridView, _creatureBossData, _e); break; } } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "自然"; if (e.NavigationMode == NavigationMode.Back) { BiomesEntranceTransition.FromVerticalOffset = 0; SmallPlantEntranceTransition.FromVerticalOffset = 0; TreesEntranceTransition.FromVerticalOffset = 0; CreatureNestEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var extraData = (ViewExtraData)e.Parameter; await Deserialize(); if (extraData != null) { if (extraData.ExpandedList != null) { //展开之前展开的Expander for (var i = 0; i < extraData.ExpandedList.Count; i++) { ((Expander)RootStackPanel.Children[i]).IsExPanded = extraData.ExpandedList[i] == "True"; } } //ScrollViewer滚动到指定位置 RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, extraData.ScrollViewerVerticalOffset, null, true); //导航到指定页面 var _e = extraData.Picture; switch (extraData.Classify) { case "NaturalBiomes": BiomesExpander.IsExPanded = true; OnNavigatedToNaturalBiomesDialog(NaturalBiomesGridView, _naturalBiomesData, _e); break; case "NaturalSmallPlants": SmallPlantExpander.IsExPanded = true; OnNavigatedToNaturalSmallPlantDialog(NaturalSmallPlantGridView, _naturalSmallPlantData, _e); break; case "NaturalTrees": TreesExpander.IsExPanded = true; OnNavigatedToNaturalTreesDialog(NaturalTreesGridView, _naturalTreesData, _e); break; case "NaturalCreatureNests": CreatureNestExpander.IsExPanded = true; OnNavigatedToNaturalCreatureNestDialog(NaturalCreatureNestGridView, _naturalCreatureNestData, _e); break; } } }
public UserProfileSettingsFlyout() { Showed += (s, e) => { RootScrollViewer.ChangeView(null, 0.0, null, true); }; InitializeComponent(); Loaded += (s, e) => { RootStackPanel.AddHandler(PointerWheelChangedEvent, new PointerEventHandler(RootStackPanel_PointerWheelChanged), true); RootScrollViewer.ViewChanged += RootScrollViewer_ViewChanged; UserProfileTweetPivot.SelectionChanged += UserProfileTweetPivot_SelectionChanged; UserProfileStatusesListView.PointerWheelChanged += UserProfilePivotListView_PointerWheelChanged; UserProfileFavoritesListView.PointerWheelChanged += UserProfilePivotListView_PointerWheelChanged; UserProfileFollowingListView.PointerWheelChanged += UserProfilePivotListView_PointerWheelChanged; UserProfileFollowersListView.PointerWheelChanged += UserProfilePivotListView_PointerWheelChanged; }; UserProfileStatusesListView.Loaded += (s, e) => { _userProfileStatusesListViewScrollViewer = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(UserProfileStatusesListView, 0), 0) as ScrollViewer; _userProfileStatusesListViewScrollViewer.ViewChanged += UserProfilePivotListView_ViewChanged; RootScrollViewer_ViewChanged(RootScrollViewer, null); }; UserProfileFavoritesListView.Loaded += (s, e) => { _userProfileFavoritesListViewScrollViewer = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(UserProfileFavoritesListView, 0), 0) as ScrollViewer; _userProfileFavoritesListViewScrollViewer.ViewChanged += UserProfilePivotListView_ViewChanged; RootScrollViewer_ViewChanged(RootScrollViewer, null); }; UserProfileFollowingListView.Loaded += (s, e) => { _userProfileFollowingListViewScrollViewer = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(UserProfileFollowingListView, 0), 0) as ScrollViewer; _userProfileFollowingListViewScrollViewer.ViewChanged += UserProfilePivotListView_ViewChanged; RootScrollViewer_ViewChanged(RootScrollViewer, null); }; UserProfileFollowersListView.Loaded += (s, e) => { _userProfileFollowersListViewScrollViewer = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(UserProfileFollowersListView, 0), 0) as ScrollViewer; _userProfileFollowersListViewScrollViewer.ViewChanged += UserProfilePivotListView_ViewChanged; RootScrollViewer_ViewChanged(RootScrollViewer, null); }; SizeChanged += UserProfileSettingsFlyout_SizeChanged; UserProfileSettingsFlyout_SizeChanged(null, null); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "食物"; if (e.NavigationMode == NavigationMode.Back) { RecipeEntranceTransition.FromVerticalOffset = 0; MeatEntranceTransition.FromVerticalOffset = 0; VegetableEntranceTransition.FromVerticalOffset = 0; FruitEntranceTransition.FromVerticalOffset = 0; EggEntranceTransition.FromVerticalOffset = 0; OtherEntranceTransition.FromVerticalOffset = 0; NoFcEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var parameter = (List <string>)e.Parameter; await Deserialize(); if (parameter == null || parameter.Count == 0) { return; } if (parameter.Count > 3) { //展开之前展开的Expander for (var i = 3; i < parameter.Count; i++) { ((Expander)RootStackPanel.Children[i - 3]).IsExPanded = parameter[i] == "True"; } //ScrollViewer滚动到指定位置 if (!string.IsNullOrEmpty(parameter[2])) { RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, double.Parse(parameter[2]), null, true); } } //导航到指定页面 var _e = parameter[1]; switch (parameter[0]) { case "FoodRecipe": RecipesExpander.IsExPanded = true; OnNavigatedToFoodRecipeDialog(_e); break; case "FoodMeats": MeatsExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodMeatGridView, _foodMeatData, _e); break; case "FoodVegetables": VegetablesExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodVegetableGridView, _foodVegetableData, _e); break; case "FoodFruits": FruitsExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodFruitGridView, _foodFruitData, _e); break; case "FoodEggs": EggsExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodEggGridView, _foodEggData, _e); break; case "FoodOthers": OtherExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodOtherGridView, _foodOtherData, _e); break; case "FoodNoFc": NoFcExpander.IsExPanded = true; OnNavigatedToFoodDialog(FoodNoFcGridView, _foodNoFcData, _e); break; } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { Global.FrameTitle.Text = "皮肤"; if (e.NavigationMode == NavigationMode.Back) { BodyEntranceTransition.FromVerticalOffset = 0; HandsEntranceTransition.FromVerticalOffset = 0; LegsEntranceTransition.FromVerticalOffset = 0; FeetEntranceTransition.FromVerticalOffset = 0; CharactersEntranceTransition.FromVerticalOffset = 0; ItemsEntranceTransition.FromVerticalOffset = 0; StructuresEntranceTransition.FromVerticalOffset = 0; CrittersEntranceTransition.FromVerticalOffset = 0; SpecialEntranceTransition.FromVerticalOffset = 0; HallowedNightsSkinsEntranceTransition.FromVerticalOffset = 0; WintersFeastSkinsEntranceTransition.FromVerticalOffset = 0; YearOfTheGobblerSkinsEntranceTransition.FromVerticalOffset = 0; TheForgeEntranceTransition.FromVerticalOffset = 0; EmotesEntranceTransition.FromVerticalOffset = 0; OutfitSetsEntranceTransition.FromVerticalOffset = 0; } if (Global.GetOsVersion() >= 16299) { var dimGrayAcrylicBrush = new AcrylicBrush { BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = Colors.Transparent, TintColor = Global.TinkColor, TintOpacity = Global.TinkOpacity }; RootStackPanel.Background = dimGrayAcrylicBrush; } var extraData = (ViewExtraData)e.Parameter; await Deserialize(); if (extraData != null) { if (extraData.ExpandedList != null) { //展开之前展开的Expander for (var i = 0; i < extraData.ExpandedList.Count; i++) { ((Expander)RootStackPanel.Children[i]).IsExPanded = extraData.ExpandedList[i] == "True"; } } //ScrollViewer滚动到指定位置 RootScrollViewer.UpdateLayout(); RootScrollViewer.ChangeView(null, extraData.ScrollViewerVerticalOffset, null, true); //导航到指定页面 var _e = extraData.Picture; switch (extraData.Classify) { case "SkinsBody": BodyExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsBodyGridView, _SkinsBodyData, _e); break; case "SkinsHands": HandsExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsHandsGridView, _SkinsHandsData, _e); break; case "SkinsLegs": LegsExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsLegsGridView, _SkinsLegsData, _e); break; case "SkinsFeet": FeetExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsFeetGridView, _SkinsFeetData, _e); break; case "SkinsCharacters": CharactersExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsCharactersGridView, _SkinsCharactersData, _e); break; case "SkinsItems": ItemsExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsItemsGridView, _SkinsItemsData, _e); break; case "SkinsStructures": StructuresExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsStructuresGridView, _SkinsStructuresData, _e); break; case "SkinsCritters": CrittersExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsCrittersGridView, _SkinsCrittersData, _e); break; case "SkinsSpecial": SpecialExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsSpecialGridView, _SkinsSpecialData, _e); break; case "SkinsHallowedNightsSkins": HallowedNightsSkinsExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsHallowedNightsSkinsGridView, _SkinsHallowedNightsSkinsData, _e); break; case "SkinsWintersFeastSkins": WintersFeastSkinsExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsWintersFeastSkinsGridView, _SkinsWintersFeastSkinsData, _e); break; case "SkinsYearOfTheGobblerSkins": YearOfTheGobblerSkinsExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsYearOfTheGobblerSkinsGridView, _SkinsYearOfTheGobblerSkinsData, _e); break; case "SkinsTheForge": TheForgeExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsTheForgeGridView, _SkinsTheForgeData, _e); break; case "SkinsEmotes": EmotesExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsEmotesGridView, _SkinsEmotesData, _e); break; case "SkinsOutfitSets": OutfitSetsExpander.IsExPanded = true; OnNavigatedToSkinsDialog(SkinsOutfitSetsGridView, _SkinsOutfitSetsData, _e); break; } } }