提高页面加载速度
在我的应用程序中,我有一个全景页面,其中包含大约 10 个全景项目。每个全景项目都有一些路径图、一个列表选择器和几个输入字段。
我面临的问题是,每当我导航到此页面时,由于需要初始化大量内容,导航速度非常慢。如果我评论
InitializeComponent();
the loading becomes fast.I thought of adding the XAML content in code, but the problem is that i've to access the input fields by their name in code, so it didn't worked.
Any idea how i can speed up the navigation to the page.
Thanks..
In my app, I've a panorama-page which contains around 10 panorama items. Each panorama item has some path drawings, a list picker and few input fields.
The problem i'm facing is that whenver i navigate to this page the navigation is very slow due to lot of content to initialize. If i comment the
InitializeComponent();
the loading becomes fast.
I thought of adding the XAML content in code, but the problem is that i've to access the input fields by their name in code, so it didn't worked.
Any idea how i can speed up the navigation to the page.
Thanks..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来自UI 指南:
此外,10 个 PanoramaItems 似乎很多,因为建议的最大数量是 4。您应该减少数量,或者隐藏内容直到需要为止。请阅读 上的全景图最佳实践指南MSDN。
From the UI Guide:
Also, 10 PanoramaItems seems like a lot since the recommended maximum is 4. You should either cut down on the number, or hide the content until it's required. Have a read of the best practice guide for Panoramas on MSDN.
我认为您可以通过为特定全景项目创建用户控件来提高页面性能,向页面添加一个空的全景控件(仅包含标题),并按照 picypg 建议在需要时加载这些用户控件。
另一种方法可能是加载第一页并向用户显示该页面。在后台,您可以开始加载其他全景项目。
我建议的方法是第一种。使用延迟加载原理。
I think you could improve page performance by creating usercontrols for the specific panorama items, add an empty panorama control to your page (with only the headers) and as picypg suggests load these usercontrols when they are needed.
Another way could be that you load the first page and show this one already to the user. In the background you could start loading the other panorama items.
My suggested approach would be for the first one. Using the lazyloading principle.
我假设您的延迟是由于页面上的项目数量所致。这将导致一个非常大的对象图,并且需要很长时间才能创建。我还预计它会使用大量内存,并且填充率非常高,这会减慢 GPU 的速度。
如果您不小心,在 PanoItems 上添加输入项/字段可能会导致用户体验问题。
许多 panoItem 也可能会给用户带来潜在的导航问题。
I woudl assume that your delays are due to the number of items on the page. This will lead to a very large object graph which will take a long time to create. I'd also expect it's using lots of memory and you have a very high fill rate which is slowing down the GPU.
Having input items/fields on PanoItems can cause UX issues if you're not careful.
That many panoItems could also cause potential navigation issues for the user.