简体   繁体   English

Windows商店应用程序页面导航至空白

[英]windows store app page blank when navigating to it

I have 3 pages in my application. 我的申请中有3页。

First page: 5 Button s, each navigates to different page (currently, only the first button works). 第一页:5个Button ,每个Button都导航到不同的页面(当前,只有第一个按钮有效)。

Second page: Back Button and ListView , the ListViewItems are UserControlItems with Button , Image and TextBlock . 第二页: Back ButtonListViewListViewItems是具有ButtonImageTextBlock UserControlItems When you click on the Button (of the UserControlItem ) it Navigates to the third page, which is Media Player Page with alot of controls. 当您单击( UserControlItemButton ,它导航到第三页,即带有许多控件的Media Player页面。

Third page: Media Player page with alot of controls such as MediaElement , Slider , Button s and more 第三页:Media Player页面,其中包含许多控件,例如MediaElementSliderButton等等

When I navigate from Third Page to Second Page using the Back Button , sometimes the screen stays black (the color of the theme) and sometimes it loads too much time. 当我使用“ Back Button第三页导航到第二页时有时屏幕会保持黑色(主题的颜色), sometimes会加载太多时间。 In addition, the ListView has visible vertical scrollbar (always) which is not shown unless you move your mouse on the ListView . 此外, ListView具有可见的垂直scrollbar (始终),除非您在ListView上移动鼠标,否则不会显示该scrollbar

How to fix these problems? 如何解决这些问题?

EDIT 1: 编辑1:
link to my project - put some .wmv/.mp3/.mp4 files in the Videos Library folder. 链接到我的项目 -在视频库文件夹中放入一些.wmv / .mp3 / .mp4文件。

EDIT 2: 编辑2:
I investigated the black page issue abit more and I found that the MediaElement is the cause. 我对黑页问题进行了更多调查,发现是MediaElement引起的。
The MediaElement stores the stream and it slows the computer. MediaElement存储流,这会降低计算机的速度。

In order to resolve to problem, when you click on the GoBack Button , it first set the source of the MediaElement to null, and only when the MediaElementState == Closed, I go back - seems to solve my problem (since I applied the solution I didnt experience more black screens). 为了解决问题,当您单击GoBack Button ,它首先将MediaElement的源设置为null,只有在MediaElementState == Closed时,我才返回-似乎解决了我的问题(因为我应用了解决方案我没有遇到更多的黑屏)。

About the scrollbar - I think I'll be able to solve it if I simulate MouseOver over the ListView - no idea how to do it 关于滚动条-如果我在ListView模拟MouseOver ,我想可以解决它-不知道如何做

Ok Ill List out the issue one by one. 确定疾病逐一列出问题。

List View Scroll Bar : Since we are developing for a potential touch surface so scrollbars are not meant to be visible every time. 列表视图滚动条:由于我们正在开发潜在的触摸表面,因此滚动条并非每次都可见。

Blank Page : When you press the back button then Big page Ie third page gets stored in the forward navigation property of the history element. 空白页:按下返回按钮时,大页即第三页即存储在历史记录元素的正向导航属性中。 Additionally all the resources that were being used in the third page is disposed. 另外,将处置第三页中正在使用的所有资源。 So the time taken to go to second page becomes huge. 因此转到第二页所花费的时间变得巨大。

Please try havig a fourth page which will have less controls. 请尝试浏览第四页,该页面的控件较少。 And see if any Black background issue is occuring or not. 并查看是否出现任何黑色背景问题。 It will give a better and clear picture. 它将提供更好,更清晰的画面。

--- Update Code for permanent visibility of scroll bar--- ---更新代码以永久显示滚动条---

Please download the code for listview styling from 请从以下位置下载用于listview样式的代码

Listview styles 列表视图样式

add your code to the project 将您的代码添加到项目中

and replace all FadeOutAnimation By FadeInAnimation. 并将所有FadeOutAnimation替换为FadeInAnimation。

This was the quickest I could do for a solution. 这是我最快可以解决的方法。 For a Better one you can always play with the styles. 对于更好的人,您可以随时使用样式。

Ohh one more thing please add 哦,还有一件事,请添加

 Style="{StaticResource    ListViewStyle1}" 

To your list view. 到您的列表视图。 please try and let me know. 请尝试让我知道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在页面之间导航时,Windows存储应用程序暂停 - Windows store app pause when navigating between pages Windows Phone应用导航到页面实例 - windows phone app navigating to an instance of page 在Universal Windows App中导航到设备特定页面 - Navigating to Device Specific Page in Universal Windows App Windows 8.1 App C#XAML帮助:导航回到上一页时,保存单选按钮选择 - Windows 8.1 App C# XAML help: Save radio button selection when navigating back to previous page Windows Store是否从App.xaml.cs导航? - Windows Store Navigating from App.xaml.cs? 导航到其他页面/门户时如何/在何处存储页码 - how/where to store the page numbers when navigating to other page / portal Windows 8.1应用商店:页面加载时FadeInThemeAnimation - Windows 8.1 Store App: FadeInThemeAnimation when page loads 将Bing映射添加到页面时,Windows Store应用程序崩溃 - Windows Store app crash when adding Bing maps to the page 导航回到Windows Phone 8.1应用程序的主页会导致异常 - Navigating back to Main Page in Windows Phone 8.1 app causes exception 当页面向后导航到使用MapControl的页面时,UAP应用程序崩溃 - UAP app crashes when page navigating backwards to page with MapControl
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM