uwp

How to deploy a file in UWP

南笙酒味 提交于 2019-12-06 15:46:26
My UWP needs to load a file and I want to know: Where to put this file, in the package installation folder or the application data folder? How to deploy this file to the folder I want when I deploy my app using VS 2015? You can add files either as resources or content files to your project. If the file is something like a Image, SQLite Database or text file, the best approach will be the Content build action. You can then access the file using StorageFile.GetFromApplicationUriAsync : var storeLogoFile = StorageFile.GetFromApplicationUriAsync( new Uri( "ms-appx:///Assets/StoreLogo.png" ) ); You

UWPXamlHost control - UWP controls in desktop apps - Info and Status?

妖精的绣舞 提交于 2019-12-06 15:34:07
问题 The most interesting announcement for me from the Microsoft Build 2018 developer conference was the demo showing the use of UWP controls in WPF and WinForms apps. (https://youtu.be/ojZioTg5RUk?t=2250) Specifically they used a control named UWPXamlHost to achieve this functionality. So my questions would be: Is this control already available as a preview somewhere and if not is there an expected time frame when it will be available? Will it be part of the UWP Community Toolkit? Feel free to

UWP trial version and products purchase that make full version with expiration

我们两清 提交于 2019-12-06 15:32:25
I'm working with UWP and trying to make the app with a trial version (1 month) and products purchase that make full version with expiration (1 month and 1 year). The general idea is, when the user downloads for first time the app, he has a trial period of 1 month with ads. After the month of trial version the app asks that need to buy a product with a periord of time and with this remove adds. The problem is that I don't know how to make at same time the buy of full version and product expiration, or make the full version with expiration. I believe the answer here is to use the Microsoft Store

UWP Bluetooth LE InvalidCastException

左心房为你撑大大i 提交于 2019-12-06 15:22:05
问题 i want to connect the myo wristband to the hololens. This is the end goal, but I am anyway but close to that :-/ The idea is to set up a Bluetooth LE Connection with UWP. I wanted to do this, as explanined in this Microsoft Document The search for the devices workes fine, but when I try to connect to a device, this line (Point "Connecting to the device" ): GattDeviceServicesResult result = await device.GetGattServicesAsync(); raises the error: System.InvalidCastException: "Unable to cast

UWP app does not copy file to AppData folder

泄露秘密 提交于 2019-12-06 14:48:44
I made a C# executable which make a test folder and copy test.txt file from it's execution folder to AppData folder. Here is my code: static void Main() { string fullPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\test"; string destination = $"{fullPath}\\test.txt"; Directory.CreateDirectory(fullPath); string location = System.Reflection.Assembly.GetExecutingAssembly().Location; int index = location.LastIndexOf("\\"); string source = $"{location.Substring(0, index)}\\test.txt"; File.Copy(source, destination); } Then I make appxmanifest.xml file using the

UWP Get selected nodes from TreeView control

不羁岁月 提交于 2019-12-06 14:46:40
How do you get the currently highlighted/selected node from a TreeView control? Based on the documentation here it should be possible to iterate through the control's SelectedNodes property but its always empty. EDIT: This turns out to be an actual bug with XAML, tracked here . Until it's fixed, the accepted answer does fine as work-around. Context: I'm working on a simple demo application to explore the TreeView control. I'm trying to add a keyboard shortcut to delete the currently active/selected node. I have the delete functionality in a RelayCommand class that implements ICommand . I have

Using multiple views with Template10 without always showing the Main Page?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 14:08:44
I am new to T10 and trying to learn it. This is a follow-up to Template 10 Multiple Windows In 'regular' (meaning non-Template10) UWP app I've learned to do something like this (as a short example) in order to support multiple views: public App() { InitializeComponent(); Suspending += OnSuspending; } readonly List<CoreDispatcher> _dispatchers = new List<CoreDispatcher>(); protected override async void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if (rootFrame == null) { rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed;

How to get the system accent color for UWP-Apps?

流过昼夜 提交于 2019-12-06 14:08:20
问题 I'm trying to get the Accent Color of a user in a UWP-App for Windows 10. I know how to get it in C#, but I develop my apps in WinJS. So does anyone knows the WinJS equivalent for var color = (Color)Application.Current.Resources["SystemAccentColor"]; ? It would also be nice, if I could Access this Color with CSS. I found some hints, that color: Highlight; would be the solution, but this gives me only a blue and not the Accent Color. Thanks alot. 回答1: you can use WinRT API to do that : Windows

VS2015 error “Application is not currently attached to a script debug target that supports script diagnostics”

↘锁芯ラ 提交于 2019-12-06 14:05:32
问题 I created JS & HTML5 Blank App with Visual Studio 2015 . When running it in VS debugger in "Local Machine" mode, I get the following error message: Application is not currently attached to a script debug target that supports script diagnostics Just ignoring the error is not workable as at least breakpoints and console.log("text") do not work. I'm having default options in VS. I am running normal Win10 , with automatic updates on. Reinstallation of VS2015 did not solve the issue. 回答1: This

Filepicker for Hololens: List available filepickers?

て烟熏妆下的殇ゞ 提交于 2019-12-06 14:04:45
So HoloLens is stupid in that it only recognizes one FilePicker at a time (no matter how many may be installed). I don't believe the developers are going to try making multiple filepickers work. So, I'm trying to figure out my own filepicker in an attempt to be a proxy-select for other filepickers. In essence, I want to make a filepicker chooser that appears as a typical filepicker (if that makes sense). Trouble is, it doesn't appear possible to get a list of pickers installed! Am I experiencing a pipe dream, or is there a way to invoke a picker from a list of pickers? For the moment this is a