问题标签 [windows-10-mobile]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
5 回答
15007 浏览

c# - 处理返回导航 Windows 10 (UWP)

在我的 Xaml 页面中,我有一个框架。

我试图让 backButton 事件在 frame 内导航。

所以我尝试使用这段代码

但是在手机中完成HardwareButtons_BackPressed事件后它会关闭应用程序。

似乎在 MainPage 上运行了一些默认的后退按钮行为......

我该如何解决?在 Windows10 中,他们是否添加了新事件来处理后退导航?


[更新]

现在我发现SystemNavigationManager在 Windows 10中使用比在Input.HardwareButtons.BackPressed.

0 投票
1 回答
244 浏览

windows-phone-8.1 - 使用 android AAR (NFC) 启动 Windows Phone 应用

我有一个带有硬编码 NFC 标签的设备,它可以打开基于 Android 应用程序记录 (AAR) 的 Android 应用程序。基本上,它调用一个 Android 应用程序以使用类型 android.com:pkg 和有效负载 com.something.Something 打开。

我研究了如何使用现有标签启动我的 Windows Phone 应用程序,但最后我发现如果 NFC 标签被充分编程以打开 Windows Phone 应用程序 ID 或注册的自定义协议,Windows Phone 才能启动应用程序在我的应用程序中。但我使用现有的 NFC 标签打开 Android 应用 ID 非常重要。

奇怪的是,当我用手机触摸它并提示我是否要启动应用程序时,我的 Windows 10 Mobile 检测到这个现有的 NFC 标签想要打开应用程序?但是没有安装具有该 ID 的应用程序,因此我研究了如何将此应用程序 ID 放在我的 Windows Phone 应用程序上,但最后我只收到了部署错误。

0 投票
2 回答
8318 浏览

c++ - 如何使用 CMake 生成 Windows 10 通用项目

我正在尝试使用 CMake 为 Windows 10 生成 Visual Studio 15 项目 c++ 静态库。它应该可以在手机上使用,所以我认为它应该支持 Windows 商店。我可以设置任何标志吗?

我找到了https://github.com/Microsoft/CMake,它是 Microsoft 的 CMake 分支,但我找不到如何使用它来启用通用应用程序支持的线索。

当我打开对 Windows stope 的支持时,使用“正常”cmake 时出现错误:

错误 MSB3843:项目“project1”针对平台“Windows”,但引用了针对平台“UAP”的 SDK“Visual C++ 2015 Runtime for Universal Windows Platform Apps v14.0”。

0 投票
0 回答
131 浏览

xaml - 在 Windows 10 应用程序中使用来自另一个程序集的样式

我有一个来自 Windows 10 的通用 Windows 类库,我在其中实现了一些自定义控件和主题。现在我放了一个颜色资源字典。

在 WinRT 中将这个 ResourceDictionary 实现到我们的主项目中是这样的:

GeekyTheory 是我的程序集的命名空间。这是有问题的开源项目

但是我们如何在 Windows 10 中处理这个问题呢?

谢谢!

0 投票
2 回答
5510 浏览

c# - 清除返回堆栈导航 Windows 10

我想清除我的导航返回堆栈历史...

我尝试使用this.NavigationService.RemoveBackEntry();但它没有用。

我怎么能在 Windows 10 中做到这一点?

0 投票
1 回答
4889 浏览

c# - ScrollViewer (UWP) 中的移动图像

我有一个ImageScrollviewer...

当我用鼠标指针拖动图像时,我想移动图像!

我试过了:

但我无法获得指针位置来更改滚动查看器的位置。

我的代码有什么问题?我做对了吗?

0 投票
1 回答
3396 浏览

c# - x:Bind image with null string

In XAML I have the following line:

In ViewModel:

App compiles fine but during execution (since Data is populated after few seconds), the app crashes with the following exception:

System.ArgumentException: The parameter is incorrect.

Debugger breaks at:

Apparently, this occurs since MainPic is returning null.

Now, this code works fine in WP8.1. I have tried returning uri which results in Compile time error. I believe only string can be binded to image source in Win 10 (?) I just want a blank white area until data is populated hence I don't wish to give a local image source as fallback. Can someone help me port this for Win 10?


UPDATE:

Thanks to the users who answered, following conclusion is drawn (for UWP):

  • If you're binding image source to a string, it cannot be null or empty "". A singe character "x" or a space " " would work.
  • If you bind to a BitmapImage, returning null works.
  • You can use any of the methods mentioned by @Justin-xl . For me, changing all vm's to stop returning null was hard. So adding a simple convertor to xaml also does the trick.

Here's the converter code:

0 投票
2 回答
116 浏览

android - 检查安卓运行时

由于现在可以在 windows mobile 上执行 apk 文件,有没有办法检查环境是否在 windows 上模拟?我想知道该应用程序是否在 Windows 平台上执行。

0 投票
1 回答
361 浏览

xaml - 适用于 Windows 10 的通用应用程序的内存使用情况

当我们为 Windows 10 构建通用应用程序时,为了支持多种分辨率,我们可以使用自适应触发器

在这种情况下,对于每个视觉状态,使用单独的布局。如果我们要采用 3 种尺寸,则必须为每个布局创建,因此对于大多数控件来说,将有多个重复项,这些重复项在适当的视觉状态下被隐藏并变为可见。

所有这些控件都将被加载到内存中并浪费 RAM,这对于低内存手机(如 lumia 620)来说可能是危险的。

在这种情况下使用单独的视图是正确的解决方案吗?

更新

如果有人需要,这里有关于元素布局重新排序形式wintellect(AdaptiveTrigger,改变网格中的元素位置)和Galasoft(AdaptiveTrigger,RelativePanel)的很好且非常简单的文章。

0 投票
5 回答
15418 浏览

windows-10 - Visual Studio 2015:模拟器无法验证虚拟机是否正在运行

我有以下问题,希望有人有解决方案。以前我有 Windows 8.1 和 Visual Studio 2013。我升级到 Windows 10。我安装了 Visual Studio 2015 Enterprise。我创建了一个新的解决方案,其中只有一个用于空白通用 Windows 应用程序的项目。我正在使用 C#。

当通过选择任何“Mobile Emulators 10 ....”来运行我的项目时,我收到以下错误: 在此处输入图像描述 但是,如果我选择“模拟器”它可以工作。此外,如果我打开 Windows Phone 8.1 的解决方案并使用“Emulator 8.1”运行,它可以工作。

欢迎任何帮助。谢谢你。