none
Win8 Store App 转成Win8.1 Store App,编译问题 RRS feed

  • 问题

  • 问题一:

    一直用Win8 9200 + vs2012RTM环境开发Win Store App,现在推出了Win8.1,因为要添加的新功能只有Win8.1SDK存在,因此安装了Win8.1+VS2013 Ultimate Preview的环境,将原来Project拷贝到新平台,打开要求Upgrade,同意后,能成功打开工程,

    1. 若选择不同意,显示Project unavailable,关闭后再次打开就无提示Upgrade,难道只能再次拷贝一份旧Project吗?

    2.选择同意,开始编译,出现error

          Could not copy the file “Generated Files\Common\CustomizeStyles.xbf” because it was not found

          Could not copy the file “Generated Files\Common\StandardStyles.xbf” because it was not found

    对比直接用VS2013 budid的store app project,原来已经隐藏该StandardStyles.xaml文件,请问如何解决此error?

    查看8.1 project的 App.xaml,已经不再包含下述代码

      <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>

                    <!--
                        Styles that define common aspects of the platform look and feel
                        Required by Visual Studio project and item templates
                     -->
                    <ResourceDictionary Source="Common/StandardStyles.xaml"/>
                </ResourceDictionary.MergedDictionaries>

            </ResourceDictionary>

    那请问,像Win8那样 自定义一个ResourceDictionary的xaml文件来存放样式的方法还能使用吗

    问题二:

    编译时关于ViewManagement::ApplicationView将被舍弃的警告,研究了下Win8.1  两个App共存在屏幕上时状态更多,不再是Snap、Fill、FullScreen状态,关于这个APP布局问题可否有一些说明文档?

    谢谢


    2013年10月22日 6:32

答案

全部回复

  • Hi,

    如果您没有选择Upgrade的话那您就只能再次拷贝一份project

    关于您的第二个问题,因为我在测试的时候并没有出现此类error,您说的对,创建新的8.1程序的时候,StandardStyles.xaml是不存在的。但是我用VS2013打开windows 8 project的时候,StandardStyles.xaml还是继续存在的。您可以先创建一个简单的windows 8程序,然后用VS2013测试下,是否还会出现此类问题。

    关于windows 8 update to windows 8.1,您可以参考以下几个链接:

    http://blogs.windows.com/windows/b/appbuilder/archive/2013/07/24/windows-8-to-windows-8-1-preview-starting-with-the-xaml-templates.aspx

    http://msdn.microsoft.com/en-us/library/windows/apps/dn263114.aspx

    另外,windows8.1虽然优化了资源的使用和加载,但是还是支持ResourceDictionary这种方式,具体请参考:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.resourcedictionary.aspx

    Windows 8.1已经不存在SnapFillFullScreen这几种状态,以下链接的Updates to the ApplicationView class里面有详细的说明,您可以参考一下:

    http://msdn.microsoft.com/en-us/library/windows/apps/bg182890.aspx#one

    祝您好运!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • 已标记为答案 denny_zhuyi 2013年10月28日 3:13
    2013年10月23日 3:30
    版主
  • 非常感谢您的解答。

    又遇到新的问题:

    您说 Win8.1支持ResourceDictionary这种方式,确实是,发现诸如Button等控件自定义样式,然后利用

    Style = {StaticResource ButtonStyle1},来对某Button加载自定义样式。

    但是发现Slider存在问题:所有Slider按上述方式加载自定义样式时报错,从而不能生成编辑界面,但是还是能编译并运行。

        对Win8.1默认的Slider右击选择Edit Template->Edit a copy , 发现不再像Win8中那样生成Style,而是生成一个ControlTemplate,

    同时添加Template=“{StaticResource SliderControlTemplate1”} ,但依旧报错

    Unspecified error, Failed to assign to property "Windows.UI.Xaml.DependencyObject.RuntimeDataContext".[Line 166 Position 243]

    对比Win8.1生成的Template和Win8 SilderStyle中的Template部分,发现多了

    <ContentPresenter x:Name=HeaderContentPresenter"

       ....

    />

    想请问,这个问题是VSbug还是怎么回事?谢谢

    2013年10月28日 3:55
  • Hi,denny

    这个帖子的问题已经解决了,因为我们要关闭帖子,所以您的这个问题可以重新发到一个帖子!

    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2013年10月30日 5:35
    版主