uwp

Is DataGrid an alternative for UWP?

自闭症网瘾萝莉.ら 提交于 2019-12-12 17:28:53
问题 I'm developing a UWP app that is supposed to be used on PC and Tablets and in a lite version later on mobiles. On PCs I want to provide data in two columns, on mobile I intend to hide one of them (or I'll create a different page), depending to the user's actions. Functionalities I need are; databinding to a List<T> (or anything equal), to filter, sort(not important) and select items, like I did before with the Datagrid. Values of the selected item should be shown to be edited in two textboxes

Save and XDocument to a file in a “using stream”

╄→гoц情女王★ 提交于 2019-12-12 17:13:40
问题 So I'm trying to do the simple task of opening an XML file, adding and XElement to it, and saving it. My curent code doesn't work: Uri dataUri = new Uri("ms-appx:///XML Files/Pinouts.xml"); StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri); using (var stream = await file.OpenStreamForWriteAsync()) { XDocument doc = XDocument.Load(stream); doc.Add(new XElement(XElement.Parse(CurrentPinOut))); doc.Save(stream); stream.Flush(); } As I get an "Access denied" error. I'm

Image in the interface is not updated after WritableBitmap has changed

别等时光非礼了梦想. 提交于 2019-12-12 16:20:35
问题 I am trying to update the image by drawing circles every time mouse pointer is moved. The pixelBuffer is stored in map object and updated with CircleFilledWithGradientMethod() . I load the pixel buffer in to WriteableBitmap Bitmap and then try to display it by setting image source of an image element in my XAML UI to Bitmap. What happens, is that when I first move my mouse, I see the very first 2 circles drawn but then as I move the mouse, the image does not get updated. Why could that be? Is

Can't use winscard.h in a UWP app due to WINAPI_PARTITION_DESKTOP blocks

一笑奈何 提交于 2019-12-12 14:32:45
问题 I'm developing in C++ a Universal Windows Platform app. I have a working project in C++ which can communicate with smart cards. For this communication it uses the winscard.h library. I'd like to use in the UWP app this functions provided by the winscard.h , but I can't compile it in the UWP. After some research I found that in this header file there is a condition: #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) So this is the reason the compiler doesn't found the methods. Going forward

How to create a XAML custom control in code?

大兔子大兔子 提交于 2019-12-12 14:23:49
问题 I am trying to implement a custom XAML control in code, using C++/WinRT. My attempted implementation, however, failed to compile. As a prove of concept I was using this code: #pragma once #include <winrt/Windows.UI.Xaml.Controls.h> namespace MyApp { struct MyControl : winrt::implements<MyControl, winrt::Windows::UI::Xaml::Controls::Control> { }; } This resulted in the following compiler error: 1>MyControl.cpp 1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\cppwinrt\winrt\base.h

Unhandled exception at 0x00007FFCF05E675B (Windows.UI.Xaml.dll)

社会主义新天地 提交于 2019-12-12 12:34:18
问题 I've developed an UWP app , for which I have already managed to build and publish package on the Store, without any problem. As some users encounter performances problems, I would like to test my last changes by compiling the code with " .Net Native tool chain ". But I get an exception before the end of the build: If I uncheck the case " Compile with .NET Native tool chain ", there is no longer problem. The other builds parameters are " Release " and " x64 ". Would you have any idea? Why didn

Windows UWP bluetooth app, devices showing up when scanning even when they are powered off

筅森魡賤 提交于 2019-12-12 12:20:26
问题 I am developing a UWP app that is using bluetooth to connect to different devices. My problem is that some devices that has been paired or previously discovered is showing up in my device list even though they are turned off or not in range. As of my understanding the property System.Devices.Aep.IsPresent can be used to filter out cached devices that are not available at the time but I always get "True" for that property even though I know the device is not reachable. Any ideas on how this

Calling web service asynchronously in page constructor

喜你入骨 提交于 2019-12-12 12:09:28
问题 I need to load data on a XAML page in a windows 10 UWP application. For that I wrote code to call the web service in async task function, and I call this in page constructor. Could you please tell best way to do this? Following is my code. public sealed partial class MyDownloads : Page { string result; public MyDownloads() { this.InitializeComponent(); GetDownloads().Wait(); string jsonstring = result; //code for binding follows } private async Task GetDownloads() { JsonObject jsonObject =

UWP show Fullscreen Popup, ContentDialog or Flyout

穿精又带淫゛_ 提交于 2019-12-12 11:03:58
问题 I need to display a full screen dialog (in application window boundaries) in my UWP application, but can't seems to make it work. I tried with : ContentDialog only shows vertically stretched with FullSizeDesired="True" Popup, even trying to set the width and height in code behind its not working Flyout Placement="Full" only stretch it vertically just like the contentdialog Can't believe I spend so much time on that thing :( Thanks 回答1: Have you tried something like this: var c = Window

(UWP) WebClient and downloading data from URL in

帅比萌擦擦* 提交于 2019-12-12 10:47:27
问题 How do you download data from an url in UWP? I'm used to using WebClient's DownloadData-method, but it can't be used anymore. 回答1: .NET for UWP does not have the WebClient class. But you have several alternative ways to download the data from URL in UWP. For example: var request = WebRequest.CreateHttp("http://www.bing.com"); var donnetClient = new System.Net.Http.HttpClient(); var winrtClient = new Windows.Web.Http.HttpClient(); If you want to download the data at background, you can use the