uwp

使用 .NET 平台,如何玩转 Universal Windows 应用?

我们两清 提交于 2019-12-13 11:11:52
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 2015年7月30日 本文作者是 Managed Languages 团队项目经理 Lucian Wischik。 不久前, Visual Studio 2015 上新增 Windows 10 应用的开发工具—— Universal Windows App开发工具 。这个发布拥有重大意义:开发者可利用最新的 .NET 技术开发 Universal Windows Platform (「UWP」) 应用,这些应用程序可运行在任一款 Windows 设备上——Windows 手机、平板电脑或者笔记本电脑、PC 机、Xbox 游戏机,以及 Windows 新出的 HoloLens、Surface Hub 和 Raspberry Pi 2 (IoT 设备)等等。 安装 UWP 工具 开发者可 下载安装免费的 VS2015 的社区版 ,该版本默认安装 UWP 工具。如需安装专业版或是企业版,可从 VisualStudio.com 处下载安装。在安装过程中,选择「Custom(自定义)」安装 Universal Windows Apps 开发工具。 如果已经安装了 Visual Studio 2015,有两种方式获得 Universal Windows Apps 开发工具: 下载并运行 Windows Tools

C# Navigating Between Pages Without losing Data

情到浓时终转凉″ 提交于 2019-12-13 11:10:28
问题 One of my assignments is to pass data to another page which I understand. But how do I get the data to stay when I go back to the Page? Can someone explain how this works. public sealed partial class MainPage : Page { string userName; public MainPage() { this.InitializeComponent(); } private void btnPage2_Click(object sender, RoutedEventArgs e) { Frame.Navigate(typeof(Page2) , userName); } private void btnName_Click(object sender, RoutedEventArgs e) { userName = Convert.ToString(txtname.Text)

Get file paths for files in Centennial app

与世无争的帅哥 提交于 2019-12-13 11:08:54
问题 When converting an app to a Windows Store app, we add the files as mentioned here. But now - how do we access them? What's their path? They're not in the special folder created for the package. 回答1: You can create a folder structure in your project where you can include the files and then since you are already crossing the Centennial Bridge, you can start using the Windows.Storage.StorageFile WinRT API to interact with files. For example, you can use: StorageFile

How should IBuffer objects generated through Windows.Security.Cryptography be managed securely?

血红的双手。 提交于 2019-12-13 10:42:39
问题 Following on from my previous question: Do the IBuffer objects produced by the methods in Windows.Security.Cryptography.CryptographicBuffer have security features? IBuffer objects are returned and used by the cryptographic routines in WinRT. As my previous question was answered, any secure management of those buffers has to be maintained by the user--e.g. overwriting the memory, encrypting when it isn't actively needed, etc. However, methods to interact with the data underlying IBuffers are

How to Poll For Controller Input In UWP App

爱⌒轻易说出口 提交于 2019-12-13 10:31:43
问题 I'm unsure about the best practice for obtaining and updating input received from a controller monitored using the GamePad class in UWP. I've seen a couple of examples of people using Dispatch Timers and async loops inside the GamePadAdded event. In Win32 applications, I would have handled input in the WinMain update/message loop, but in UWP apps I don't know of anything similar. Is there a loop in UWP apps that input should be collected/handled like in Win32 apps? What is the recommended

如何将GridViewEX升级到UWP(Universal Windows Platform)平台

青春壹個敷衍的年華 提交于 2019-12-13 10:31:26
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 引言 上一篇文章中,我们主要讲解了如何在保证GridView控件的用户体验基础上,扩展GridView生成GridViewEx控件,增加动态添加新分组功能等,本文在上文的基础上,介绍如何在Windows10中使用GridViewEx,开发UWP应用。 Demo 下载: GridViewLiveTiles.zip GridViewEx.zip GridViewDemo.zip 开发UWP应用程序 开发UWP应用程序最好是从创建empty项目开始,重用已开发的一些模块,这样可以提高开发效率。 本文为了创建UWP 应用程序,首先创建一些通用类如下,详细代码见附件: Common/VisibilityConverter.cs Common/LayoutAwarePage.cs Common/SuspensionManager.cs DataModel 和Sample 文件夹下的所有文件都可以重用。 修改布局和导航 VisibilityConverter 和 SuspensionsManager暂时不需要修改,可直接在UWP中使用。主要修改布局和导航逻辑文件。 由于微软支持的设备种类越来越多,导致ApplicationViewState不再适用。UWP平台提供了其他的解决方法如 AdaptiveTriggers

How to create 300 stopwatches in C# more efficiently?

荒凉一梦 提交于 2019-12-13 09:45:03
问题 I'm creating an UWP application that needs to measure the time the user is looking at an object. This application has around 300 objects to measure the time of. To do this we will be using around 300 timers. To achieve this we will have to create 300 stopwatches individually which is highly inefficient. The timer starts when the user is looking at the corresponding object and stops when the user is no longer looking at the corresponding object. If the user's gaze is fixated on the

Correct way to access UI from background thread in UWP

℡╲_俬逩灬. 提交于 2019-12-13 09:04:10
问题 I need to update an ObservableCollection that is x:Binded in XAML to a ListView. I can't find the proper functionality to access the UI thread, which is also linked to threading issues which I do not understand. I get this error in various attempts: 'The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))' I am implementing MVVM. The VieModel gets the data from the model into it's ObservableCollecton via a

Taking a photo from a WebCam in UWP Background (headless) App on Win 10 IoT

旧城冷巷雨未停 提交于 2019-12-13 08:48:37
问题 I've written a headless UWP Background Application and deployed it to a Raspberry PI running Windows 10 IoT. The Pi has an old Logitech webcam plugged into one of the USB ports and I'd like to be able to capture still images from it. I've lifted code from a Microsoft Blog on the subject (albeit aimed at UWP on the Xbox), but my app seems unable to detect any cameras at all. The following call comes back with no results: var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass

Pagination in ListView (UWP)

家住魔仙堡 提交于 2019-12-13 08:27:51
问题 I have UWP where I have ListView on xaml. Here is code how I receive json, set it to List public class TopPostsViewModel : INotifyPropertyChanged { private List<Child> postsList; public List<Child> PostsList { get { return postsList; } set { postsList = value; OnPropertyChanged(); } } public TopPostsViewModel() { Posts_download(); } public async void Posts_download() { string url = "https://www.reddit.com/top/.json?count=50"; var json = await FetchAsync(url); RootObject rootObjectData =