uwp

Saving a Canvas as an image in UWP

眉间皱痕 提交于 2019-12-24 19:40:29
问题 I found this documentation for exporting and saving a Canvas as a png. It gives the following code: var Imaging = Windows.Graphics.Imaging; var picker = new Windows.Storage.Pickers.FileSavePicker(); picker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary; picker.fileTypeChoices.insert("PNG file", [".png"]); var imgData, fileStream = null; picker.pickSaveFileAsync().then(function (file) { if (file) { return file.openAsync(Windows.Storage.FileAccessMode

How to include asset files in a .NET Standard 1.4 library in ARM platform?

一世执手 提交于 2019-12-24 19:28:39
问题 Anyone know what is the correct way of referencing assets if the platform is ARM? In x86 I can use appX folder with linking but its not working on ARM thanks 回答1: If you want to get assets files from a .NET Standard library, you would need to mark the file as EmbeddedResource and Copy Always . Then, you need to add a method to get these files in your .NET Standard library's class. For example: namespace ClassLibrary1 { public class Class1 { public static Stream GetImage() { var assembly =

Creating Files and Folders in UWP

佐手、 提交于 2019-12-24 19:24:06
问题 Ive looked at at so many stackoverflow posts and articles but still didnt manage to create a file in UWP. In WPF it was really easy but UWP works differently. I added the following in my manifest file: <Capabilities> <uap:Capability Name="documentsLibrary" /> </Capabilities> Now im not sure what to do next. Inside my documents folder I have a subfolder named "Project Files". I want to create folders and files in there. How is this done in UWP? I really dont understand. 回答1: As microsoft

How to get dragover image from webView to Bitmap (UWP C#)

寵の児 提交于 2019-12-24 18:30:26
问题 I want to drag&drop image on website to Canvas on Xaml. But it is not acceptable, because dragged data is not image data but html data. So I try to get dragover thumbnail image. But I don't know how to access dragover thumbnail image. How can I access dragover thumbnail image. I want to know those code. C#. --Xaml-- <WebView x:Name="WebView" Source="https://google.com" ScriptNotify="Notify" NavigationCompleted="Completed" ></WebView> <Canvas x:Name="Board" AllowDrop="True" DragOver="dragOver"

Write to a .txt file using data from TextBox when UWP app is closed

耗尽温柔 提交于 2019-12-24 18:26:16
问题 When user closes the app, I believe the OnSuspending method in App.xaml.cs is called first before termination. So, I put my code in there in order to automatically save what the user wrote in the TextBox to a .txt file called TextFile1.txt. The program runs without errors but it doesn't save the user's data to the .txt file when app is closed. Code in App.xaml.cs : private MainPage mainFrame; private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e

Validation for UWP textbox

微笑、不失礼 提交于 2019-12-24 18:23:52
问题 I am currently developing a UWP application, I am very new to this platform and need some help. Thanks for the help! 回答1: So I was able to write up a demo project. You can find it on Github Here! I'll quickly tell you about the sample, There are two solutions: Quick and Dirty: This took the most time for me and I had to write up a lot of code for something very trivial. I don't recommend this way but this way is non complicated and straight forward. Dynamic Content way (Recommended): Here, I

Make UWP App Discoverable in iOS Bluetooth Settings

时光总嘲笑我的痴心妄想 提交于 2019-12-24 18:12:59
问题 I am trying to make my VB.NET UWP application discoverable in iOS Bluetooth settings. I have based my implementation on the Bluetooth Advertisement sample code. However, my Windows device does not appear in iOS settings. I manually enable the Bluetooth radio via the Radios API, and have added the bluetooth , proximity and radio device capabilities to my app. I can tell that a signal is being sent out by my Bluetooth adapter, so I am unsure if I am sending the wrong data. The code I am using

Change the foreground of a button when clicked

懵懂的女人 提交于 2019-12-24 17:44:12
问题 So all I am trying to do is change the color of a button when clicked but I've spent a good amount with errors and couldn't find anything helpful. Understand I am brand new to Visual Studio 2015 community. There seems to be a lot of ways to do this either using brushes or solidcolorbrushes or a conversion. Please mention using and references needed here is my button: <Button x:Name="CastButton" Click="CastButton_Click" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,35,10"

UWP/WinRT: How to use VisualState Triggers to change the styling of all controls of a certain type?

巧了我就是萌 提交于 2019-12-24 17:28:04
问题 In my UWP app, I have a series of AppBarButtons separated by AppBarSeparators . When the window size drops below a certain amount, I want to hide the AppBarSeparators to save space. I tried something like this, but it didn't work: <VisualState.Setters> <Setter Target="AppBarSeparator" Value="Collapsed"/> </VisualState.Setters> I understand it's not possible to give each of the AppBarSeparators labels so I can target them directly, because they are dynamically generated as part of a binding.

VS2017 Page is not supported in a Windows Universal project

六月ゝ 毕业季﹏ 提交于 2019-12-24 17:25:03
问题 I have a rather unpleasant problem since yesterday... I cleared my NuGet chache because I couldn't get a NuGet-Package to work with one of my codes. But it didn't help and instead f***ed up the UWP apps I wrote before that. I get errors for every element I have in my code like this: In XAML it's mostly "XXX is not supported in a WIndows Universal project" and in the .cs files its a lot of "Cannot resolve symbol XXX" How can I repair this? I can compile and run my code just fine but I can't