简体   繁体   English

在Win8中完成这些操作后,如何在Windows 8.1中进行拆分页面?

[英]Having done them in Win8, how do I do Split Pages in Windows 8.1?

My team and I have recently migrated our app from Windows 8 to Windows 8.1. 我和我的团队最近已将我们的应用程序从Windows 8迁移到Windows 8.1。 It worked fine until I went to update the existing pages and add a new one. 在我去更新现有页面并添加一个新页面之前,它运行良好。 Instead of any errors, just nothing happened. 没有任何错误,什么也没有发生。

The way I understand it is, in Windows 8, split pages had their information stored in a DataSource class, and I could even put all the stuff for all the split pages into the one class if I wanted to. 据我了解,在Windows 8中,拆分页面的信息存储在DataSource类中,如果愿意,我什至可以将所有拆分页面的所有内容都放在一个类中。

It's changed in Windows 8.1, though, so all the content for the pages go into the code behind pages for that actual page. 但是,在Windows 8.1中已对其进行了更改,因此页面的所有内容都放入该实际页面的页面后面的代码中。

I can't actually seem to find any examples, articles or anything online on how to do this. 我似乎实际上找不到任何有关如何执行此操作的示例,文章或任何在线内容。 Would anyone be able to link me to such an article or explain how the groups and items are meant to go into the class? 任何人都可以将我链接到此类文章,或解释如何将组和项目纳入课堂吗?

Thanks! 谢谢!


Reply to htuomola: 回复htuomola:

When I tried adding a new split page, at the time I didn't realise that how you put the content into the page is handled differently, so I just went and did the same as before. 当我尝试添加新的拆分页面时,当时我还没有意识到如何将内容放入页面中的方式有​​所不同,因此我只是去做和以前一样。 I admit, it might not be best practice to have done it like this, but at the time I felt it made the most sense. 我承认,这样做并非最佳做法,但当时我觉得这是最有意义的。 I had all the groups and items for the various split pages in the one data source class, and the individual pages just pointed to which items/groups I wanted. 在一个数据源类中,我具有各个拆分页面的所有组和项目,而各个页面仅指出了我想要的项目/组。 So, not knowing any better, I made an identical split page to the others, and it didn't pick up the new groups/items, but it did find the old ones. 因此,不知道有什么更好的选择,我与其他人进行了相同的拆分,并且它没有选择新的组/项目,但确实找到了旧的组/项目。 The old split pages were working fine at this point too. 此时,旧的拆分页面也可以正常工作。 It was only when I tried to make a new 8.1 style split page, that they all stopped working and threw errors like "The type 'IME.Miscellaneous.Additional.Help' already contains a definition for 'itemDetailGrid'" and ""IMEDataSource" does not exist in the namespace "using:IME.Data".", even though I didn't change the pages that are having these errors - at all. 只是当我尝试制作一个新的8.1样式拆分页面时,它们都停止工作并引发了诸如“类型'IME.Miscellaneous.Additional.Help'的类型已经包含'itemDetailGrid'和'IMEDataSource'的定义之类的错误。命名空间“ using:IME.Data”中不存在。”即使我根本没有更改出现这些错误的页面。

The Split Page item template still exists with Windows 8.1 applications even if the NavigationHelper and visual state handling code is a bit different. 即使NavigationHelper和视觉状态处理代码有些不同,“拆分页面”项目模板仍与Windows 8.1应用程序一起存在。 I think it also works pretty nicely out-of-the-box. 我认为它也可以很好地使用。 Did you try adding a new Split Page page to you project, what problems are you facing? 您是否尝试过在项目中添加新的“拆分页面”页面,您面临什么问题?

Some documentation that you can find is in MSDN project templates and item templates pages. 您可以在MSDN 项目模板项目模板页面中找到一些文档。 You should probably find a few samples in MSDN that use the Split Page/App template. 您可能应该在MSDN中找到一些使用“拆分页面/应用程序”模板的示例。

About the information storage, do you mean that in Windows 8.0 there was a separate view model class and 8.1 only has an ObservableDictionary property on code behind? 关于信息存储,您是说在Windows 8.0中有一个单独的视图模型类,而8.1仅在后面的代码上具有ObservableDictionary属性吗? Nothing prevents you from replacing that with a better solution. 没有什么可以阻止您用更好的解决方案替换它。 I'd just delete it and follow MVVM guidelines, setting up a ViewModelLocator and view models. 我将其删除并遵循MVVM准则,设置ViewModelLocator并查看模型。

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

相关问题 如何在Windows 8.1(winRT)中获取本地文件夹大小 - How do I get Local folder size in Windows 8.1 (winRT) 如何链接到外部DLL,以便Windows 8.1可以识别它? - How do I link to external DLL so that it will be recognized by Windows 8.1? 如何在Windows Phone 8.1上阅读嵌入式文本文件? - How do I read an embedded text file on Windows Phone 8.1? 如何在Windows Phone 8.1上使用HtmlAgilityPack? - How do I use HtmlAgilityPack on Windows Phone 8.1? 如何连接到Windows 8.1上的Azure blob存储? - How do I connect to Azure blob storage on Windows 8.1? 如何在Windows(8.1)中将自定义应用程序注册为Web浏览器? - How do I register a custom application as a Web Browser in Windows (8.1)? 如何以编程方式在 Windows 8.1 手机中找到 imei 号码? - How do I find imei number in windows 8.1 phone programmatically? 在win8商店应用中,如何在GridView中进行项目的淡入叠加? - in win8 store app, how to do fade-in overlay of items in GridView? 如何从Win8 Javascript metro应用程序引用C#类库? - How do you reference a C# class library from a Win8 Javascript metro application? 如何在Windows 8.1中使用Windows.Storage.FileIO.WriteFileAsync? - How do I use Windows.Storage.FileIO.WriteFileAsync in Windows 8.1?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM