uwp

Set Width and Height of ItemsControl Children

北城余情 提交于 2019-12-12 04:27:13
问题 My CustomItemsControl looks like the following: <local:CustomItemsControl x:Name="CustomItemsControl" > <local:CustomItemsControl.ItemTemplate> <DataTemplate> <Border x:Name="rectangle" Background="Orange" CornerRadius="5" /> </DataTemplate> </local:CustomItemsControl.ItemTemplate> </local:CustomItemsControl> Depending on the amount of the items which my CustomItemsControl contain, it should calculate the Width and the Height of "Container" Items. I thought I could achieve that by calling the

Reflection to get public instance properties in UWP

こ雲淡風輕ζ 提交于 2019-12-12 04:26:02
问题 I am porting a Silverlight application to UWP. In my Silverlight app, i get the public instance properties: Type t; t.GetProperties(BindingFlags.Instance | BindingFlags.Public); In UWP it look like the GetProperties(BindingFlags.Instance | BindingFlags.Public) method is no longer available. Is there another way to accomplish this in UWP? thank you. 回答1: From this MSDN source, you can do the following: var props = t.GetTypeInfo().DeclaredProperties .Where(x => x.GetMethod.IsPublic); 来源: https:

Mix DirectX 12 and XAML controls in UWP

扶醉桌前 提交于 2019-12-12 04:26:00
问题 I would like to create a UWP app (XAML) with C++/CX and DirectX 12 so that I can mix both XAML controls (things like Grid, buttons...) and DirectX, something like a Level Editor, but I'm struggling to find a way how to initialize DirectX to render inside a specific control (like a Grid). The basic template and all the other tutorials only show how to do it within the full area of the application. When creating a device resource we set the window where to draw with SetWindow(CoreWindow:

ListView - Set focus on a control in a new row (UWP)

橙三吉。 提交于 2019-12-12 04:25:58
问题 I have a ListView backed by an ObservableCollection . The user can add a new row, where in code I add a new object to the collection: array.Add(obj) . Now what I'd like to do is give focus to a TextBox in the new row. The problem is that I believe I need to wait until the UI is created, and I don't know of an event that will let me know when the new row is ready. I've tried getting the new container and a reference to TextBox in ListView_SelectionChanged , but I was getting null return values

How to save WebViewBrush as image? (UWP / Universal)

假如想象 提交于 2019-12-12 04:25:55
问题 Summary: I have a collection FrameworkElements (basically web view brushes drawn on rectanlges), and I'd like to save each of these as a PNG file in my UWP app. More details: I followed the example at https://stackoverflow.com/a/17222629/2884981 to split the content of a WebView into separate "pages". I've put the main bits of code at the bottom. At the bottom of GetWebPages() I have return pages; At this point I have a list of all the "pages". What I'd like to do, is then convert each of

AsymmetricKeyAlgorithmProvider Import

蹲街弑〆低调 提交于 2019-12-12 04:23:27
问题 My problem is that with UWP-Apps I can not use RSACryptoServiceProvider . That means I have to use CryptographicEngine to en/decrypt data. How can I Import my Public/Private Key to AsymmetricKeyAlgorithmProvider 's ImportKeyPair -Method? How do I have to create the IBuffer parameter? I have two Pem or alternatively xml files, one for Private and one for Public key, which I want to use for en/decryption. They are externally created. I already found a Solution with Chilkat's Rsa Class. But this

UWP FileSavePicker Contract File Processing

本小妞迷上赌 提交于 2019-12-12 04:22:03
问题 In my App i'm using a a FileSavePicker Contract (Provider). So other Apps could save files to my App. I implemented it, as it is shown on MSDN. The Problem now is, that i have to process a "saved" file, but how do i know, when the saving is completed? Here is my handler private async void FileSavePickerUI_TargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs args) { var deferral = args.Request.GetDeferral(); string saveFileName = sender.FileName; StorageFolder

System.Net.Ping NuGet Installation error

99封情书 提交于 2019-12-12 04:21:35
问题 I would like to use System.Net.Ping NuGet reference in a UWP Project with ARM target. I want use Ping in Windows 10 Mobile. I'm trying with "Install-Package System.Net.Ping -Version 4.0.0" but i get same message with lastest preview (Install-Package System.Net.Ping -Pre) Output: System.Net.Ping 4.0.0 provides a compile-time reference assembly for System.Net.Ping in UAP, Version = v10.0, but there is no assembly in Runtime compatible with win10-arm Line: 1 Character: 1 + Install-Package System

Detect keyboard deployment

给你一囗甜甜゛ 提交于 2019-12-12 04:16:53
问题 I am porting an WP7 Silverlight application to the UWP Windows 10 mobile platform. In my old code I used to check if the keyboard was deployed in the following way: if (DeviceStatus.IsKeyboardDeployed) { // do stuff } else { //do stuff } Now I want to do the same in WM10 but there does not seem to be an equivalent of this function anymore. I already checked the following link And Googled but cannot find it. Does anybody know if you still can detect this in any way? 回答1: I think you can make

How do I add Mysql.data.dll into uwp with c++?

柔情痞子 提交于 2019-12-12 04:02:50
问题 I have been to try to use Mysql with c++ in UWP for 2 days...but I could not do so. I already installed Mysql.data and Mysql.ConnectorNet.Data through Nuget. However when I tried to use Mysql obejct, I couldn't find anything. Intelligence does not work too so I tried to add Mysql.data.dll directly, but I couldn't do too. I just got a error message. It said that "could not add a reference to "my path" as it is not of a type or version current proejct can use." Does anyone know how to solve it?