标签: windows-10-universal

如何在UWP/RT XAML中声明系统数据类型?

我正在尝试在UWP上的XAML中访问StaticResource变量的系统命名空间.这是(大部分)我正在使用的:

<Page
    x:Class="App.UWP.Views.Step6"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="using:System"
    mc:Ignorable="d">

    <Page.Resources>
        <System:Double x:Key="ItemNameWidth">260</System:Double>
    </Page.Resources>

    <TextBlock FontSize="16" Width="{StaticResource ItemNameWidth}">foo</TextBlock>
</page>
Run Code Online (Sandbox Code Playgroud)

即使<System:Double ...>IntelliSense中的节目有效,我也会遇到以下运行时错误:

类型的异常"Windows.UI.Xaml.Markup.XamlParseException"发生在mscorlib.ni.dll但在用户代码中没有处理

WinRT信息:无法反序列化XBF元数据类型列表,因为在命名空间"System"中找不到"Double".[线:0位置:0]

如果这种方法不起作用,我会对其他声明双重的方式持开放态度.

c# xaml winrt-xaml uwp windows-10-universal

15
推荐指数
1
解决办法
1776
查看次数

部署到存储后的UWP部署错误 - Windows 10

自从在商店(测试版和私有版)中为Windows 10部署我的UWP应用程序后,我无法再将其部署到我的手机(ARM),平板电脑模拟器(x86)和本地计算机(Surface Pro 3)进行测试.

我重新启动了我的手机和我的SP3,但我仍然遇到同样的错误:

Severity    Code    Description Project File    Line    Suppression State
Error       Error : DEP0001 : Unexpected Error: Install failed.
Please contact your software vendor. (Exception from HRESULT: 0x80073CF9)   
Run Code Online (Sandbox Code Playgroud)

我用Google搜索了错误,发现了这篇文章:

https://msdn.microsoft.com/en-us/library/windows/desktop/hh973484(v=vs.85).aspx

根据这篇文章/页面,我应该检查AppXDeployment-Server日志

ERROR_INSTALL_FAILED 0x80073CF9 
Package install failed. Contact the software vendor.

Check the AppXDeployment-Server event log for more info.
Run Code Online (Sandbox Code Playgroud)

我做了,但我找不到任何有用的东西.我刚尝试重新部署到我的手机,没有添加任何条目.此日志中的最后一个条目是从现在开始的52分钟开始.我也检查了AppXDeployment日志,也没有!

是否与视觉工作室生成了新证书有关?我不确定是否诚实.

当我尝试在模拟器或本地计算机上部署它时,我得到一个不同的错误:

Severity    Code    Description Project File    Line    Suppression State
Error       Error : DEP0700 : Registration of the app failed. An
internal error occurred with error 0x80073D05. See …
Run Code Online (Sandbox Code Playgroud)

win-universal-app uwp windows-10-universal

14
推荐指数
1
解决办法
8335
查看次数

UWP authenticode签名appxbundle显示未知的发布者智能屏幕

我有一个appxbundle由Visual Studio生成的签名,并使用Comodo authenticode sha256证书签名.打开属性时,捆绑包会显示数字签名选项卡.

现在,当我在另一台PC上下载文件时,smartscreen过滤器启动并说appxbundle有一个未知的发布者.

我研究了这个问题,但似乎只有clickonce部署的解决方案.

更新

我也执行了这里提到的解决方案.简而言之:使用post build或pre-publish签名来签署.exeobj文件夹中生成的文件.这两种解决方案都无法解决问题.

更新

包含的证书屏幕截图显示证书有效:

在此输入图像描述

我的问题:我需要做些什么才能让appxbundle正确的出版商出现?

更新

我检查了Comodo并重新检查了证书链.应用程序现在可以正常加载,但Smartscreen仍然无法识别发布者.

signing appx uwp windows-10-universal

14
推荐指数
1
解决办法
449
查看次数

使用指向可执行文件的"fullTrustProcess"创建应用程序包时出错

我正在尝试使用UWP应用程序部署示例应用程序以桥接AppServices.该示例运行并构建得很好但是当我尝试按照指南打包整个事情时它给了我一个错误.

链接到包装指南

这里是AppService Bridge示例存储库.

错误信息:

 Error Manifest validation error: Line 36, Column 64, Reason: The file name  "BackgroundProcess.exe" declared for element "*[local-name()='Applications']/*[local-name()='Application']/*[local-name()='Extensions']/*[local-name()='Extension' and @Category='windows.fullTrustProcess']" doesn't exist in the package.
Run Code Online (Sandbox Code Playgroud)

我发现代码片段生成错误,但我还没有找到它的修复程序.

如果我从文件Package.appxmanifest中删除以下代码,Visual studio将成功构建包:

<Extensions>
  <uap:Extension Category="windows.appService">
    <uap:AppService Name="CommunicationService" />
  </uap:Extension>
  <desktop:Extension Category="windows.fullTrustProcess" Executable="BackgroundProcess.exe" />
</Extensions>
Run Code Online (Sandbox Code Playgroud)

但这显然也会消除过程中的桥接,这是本练习的重点.

这似乎与这个问题有些相关,但不同之处在于我有一个.exe,而这个问题似乎是为.dll解答的:

为商店构建通用应用程序时出错:"清单引用文件'MyAppName.dll',它不是有效负载的一部分."

(更新UWP工具似乎没有解决它.)

c# xaml uwp windows-10-universal desktop-bridge

14
推荐指数
2
解决办法
1727
查看次数

如何在登录后在Windows启动时自动运行第三方Windows 10应用商店

我想要实现的是:在用户登录到Windows 10后运行第三方Windows 10 Store App.

我已经发现在用户登录3个步骤后如何在启动时启动"Bing News"商店应用程序.感谢instantfundas.

不久解释了3个步骤:1:找到在Windows注册表- HKEY_CURRENT_USER\Software\Classes下[应用程序名称],并检查它是否包含"URL协议"格式"网址:APPNAME". 例如:HKEY_CURRENT_USER\Software\Classes\bingnews

2:在桌面上创建该应用程序的快捷方式:%windir%\ System32\cmd.exe/c start"""应用程序的URL协议名称:" 例如:%windir%\ System32\cmd.exe/c start"" "bingnews:"

3:将快捷方式复制到启动文件夹中:C:\ Users {用户}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

不幸的是,第三方应用程序未显示在此Windows注册表中...*HKEY_CURRENT_USER\Software\Classes*

我想启动第三方应用程序Nu.nl

(我知道Kiosk模式,但这不是我想要的解决方案.)

有人有什么想法吗?

windows-10 windows-10-desktop windows-10-universal

13
推荐指数
1
解决办法
7602
查看次数

如何在Windows 10 UWP中基于HTML内容调整Webview高度?

我目前正在使用Windows 10 UWP App并面临WebView的问题,当我的HTML内容较少时,我在javascript中获得更高的高度.我的守则如下

WebView webView = new WebView() { IsHitTestVisible = true };
                string notifyJS = @"<script type='text/javascript' language='javascript'>

                                            function setupBrowser(){
                                            document.touchmove=function(){return false;};;
                                            document.onmousemove=function(){return false;};
                                            document.onselectstart=function(){return false;};
                                            document.ondragstart=function(){return false;}
                                            window.external.notify('ContentHeight:'+document.body.firstChild.offsetHeight);
                                            //window.external.notify('ContentHeight:'+document.getElementById('pageWrapper').offsetHeight);
                                            var links = document.getElementsByTagName('a');
                                            for(var i=0;i<links.length;i++) {
                                               links[i].onclick = function() {
                                                    window.external.notify(this.href);
                                                        return false;
                                            }
                                            }
                                        }
                                    </script>";


                string htmlContent;
                if (hexcolor != null)
                {
                    htmlContent = string.Format("<html><head>{0}</head>" +
                                                    "<body onLoad=\"setupBrowser()\" style=\"margin:0px;padding:0px;background-color:{2};\">" +
                                                    "<div id=\"pageWrapper\" style=\"width:100%;word-wrap:break-word;padding:0px 25px 0px 25px\">{1}</div></body></html>",
                                                    notifyJS,
                                                    formItem.I_DEFAULT_VALUE,
                                                    hexcolor);
                }
Run Code Online (Sandbox Code Playgroud)

这里的formItem.I_DEFAULT_VALUE是 HTML without html,head and …

javascript c# webview uwp windows-10-universal

13
推荐指数
1
解决办法
1390
查看次数

以编程方式更改Windows 10 UWP App中的主题

我能够改变主题使用this.RequestedTheme = ElementTheme.Dark; 但我需要的是整个应用程序级别,因为这只会将当前页面的主题更改为黑暗.

每当我尝试这个时,App.Current.RequestedTheme = ApplicationTheme.Dark; 我总会得到这个错误

UWPApp.exe中出现"System.NotSupportedException"类型的异常,但未在用户代码中处理

有没有这样的方法,我可以将整个应用程序主题从Light更改为Dark,反之亦然?

我正在使用VS2015

c# windows-10 windows-10-mobile windows-10-universal

12
推荐指数
4
解决办法
1万
查看次数

由于PreLaunch测试,App认证失败

当我在基于Template 10的应用程序上运行App Certification时,出现以下错误:

发现错误:应用程序预启动验证检测到以下错误:◦应用程序启动前测试失败 - 49581RisingSoundMedia.ElectionCentral_1.1.7.0_x64__xrbjpqg44kdgm.

•即使没有修复也会产生影响:即使启用了预启动,应用也需要更长的时间才能启动.

•如何修复:在应用程序的OnLaunched方法实现中,确保您处理LaunchActivatedEventArgs.PreLaunch选项以预启动事件感知.

显然,即使使用Template 10,我也无法覆盖OnLaunched,因为Bootstrap类将它封装起来.

我尝试重写OnPreLaunchAsync并设置continueStartup = false; 但它没有解决问题.

有任何想法吗?

windows-10-universal template10

12
推荐指数
2
解决办法
3647
查看次数

ListView ManipulationCompleted事件在手机上不起作用

我在Windows 10 UWP应用程序中有此代码:

MyListView.ManipulationMode = ManipulationModes.TranslateX;
MyListView.ManipulationStarted += (s, e) => x1 = (int)e.Position.X;
MyListView.ManipulationCompleted += (s, e) =>
{
    x2 = (int)e.Position.X;
    if (x1 > x2)
    {
        DataController.PaneOpen(false);
    };
    if (x1 < x2)
    {
        DataController.PaneOpen(true);
    };
};
Run Code Online (Sandbox Code Playgroud)

ManipulationCompleted活动无法在手机上播放ListView.处理程序内的代码永远不会被调用.它在PC上工作正常,但在手机上不起作用.我不明白为什么.

c# windows-10 windows-10-mobile uwp windows-10-universal

11
推荐指数
1
解决办法
771
查看次数

应用内日历的周视图(通用Windows平台/ UWP)

我想知道是否有自定义视图,让我显示像Windows 10日历应用程序一样的周视图(或日视图).我看过CalendarView,但似乎不是我只能显示一周/天,小时分隔符.我看过自定义视图,但一无所获.

日历应用程序Windows 10  - 周视图

如果我必须手工制作自定义视图,任何指导?提前致谢

xaml calendar win-universal-app uwp windows-10-universal

11
推荐指数
1
解决办法
731
查看次数