uwp

Testing UWP app with xUnit on VS2015

与世无争的帅哥 提交于 2019-12-05 18:33:01
I have managed to create an xUnit project on VS2015 to unit-test UWP apps. There is a background to this question here on stackoverflow which gives some context to this question. I can compile and run the test, however when I reference a project to be tested, the following error comes up. ------ Run test started ------ Updating the layout... Checking whether required frameworks are installed... Registering the application to run from layout... Deployment complete (1857ms). Full package name: "8f4533e5-fec8-415b-94ab-6bce6b37374f_1.0.0.0_x86__5gyrq6psz227t" A user callback threw an exception.

Sharing target Universal Apps Windows 10 approach

纵然是瞬间 提交于 2019-12-05 18:22:57
I am struggling with it for a few hours and can't find working solution. My app is a target app for sharing and the problem is when it's running and user wants to share content. protected override async void OnShareTargetActivated(ShareTargetActivatedEventArgs args) { await OnInitializeAsync(); if (await CheckToken(args) != true) return; if (args.PreviousExecutionState != ApplicationExecutionState.Running) { if (await LoadData(args) != true) return; } var frame = new Frame(); var navigationService = new NavigationService(_dispatcherService) { RootFrame = frame, }; Window.Current.Content =

What are the possibillities to get overall CPU percentage usage

旧时模样 提交于 2019-12-05 18:22:31
I have the following question: In UWP, how can we get an overall CPU percentage usage, RAM usage,free RAM, Running process, etc? It's required for task manager in UWP. Hi after doing some looking it doesn't seem as if you can get the device CPU, RAM and Free Ram or the Running Processes. You can get the CPU, memory as well as the memory limits for an application. You can get these through the following ways: RAM : This is accessed through the MemoryManager Class MemoryManager.AppMemoryUsage And there are some other static members that will help you. CPU : As for CPU this is retrieved using -

ScrollViewer IsHorizontalScrollChainingEnabled and IsHorizontalRailEnabled functionality

我的梦境 提交于 2019-12-05 18:20:53
Can someone explain what these two properties do exactly? IsHorizontalScrollChainingEnabled IsHorizontalRailEnabled I tried the first one with nested ScrollViewers, but can't find any difference in functionality. Is it enabled or disabled by default? What does it do exactly, there is no information about functionality in the docs or Google available as far as i can find. Docs: True to enable horizontal scroll chaining from child to parent; otherwise, false. The two properties HorizontalScrollBarVisibility (Visible/Collapsed) and HorizontalScrollMode (Enabled/Disabled) make sense to me, but in

Can't achieve the same behavior in NavigationView's item template across Windows 10 Versions

纵然是瞬间 提交于 2019-12-05 18:19:43
I'm very frustrated trying to achieve the same visual behavior in my UWP app. Here is my problem: I’m using a NavigationView and I want to supply the NavigationViewItem(s) from the ViewModel. I also want to supply headers, so I create an ICollectionDataItem interface and implement ViewModels for both the NavigationViewItem and NavigationViewItemHeader so that the Main View Model supplies a list of ICollectionDataItem to the NavigationView and a DataTemplateSelector do the magic. This is how it looks like right now: <NavigationView MenuItemsSource="{Binding Home.CollectionsView, Source=

How do I get access to Windows.Storage namespace?

北慕城南 提交于 2019-12-05 17:39:55
I want to save data to files for my Microsoft Store app, so I need access to Windows.Storage namespace, but it's unclear how I can get it. I couldn't add it as a reference. I'm using Visual Studio 2017 with .NET Framework 4.6.1. My app is a Windows Forms application that I converted to UWP using the Desktop Bridge. The recommended steps to get access to UWP APIs are listed in the dedicated blog post on Windows Blog . Basically you can take two approaches: add the references to UWP dlls and winmd files manually or use the UwpDesktop NuGet package that will take care of this for you

Is it possible to build UWP app in Mac?

折月煮酒 提交于 2019-12-05 17:26:29
问题 Is it possible to build the UWP app in the Mac platform? Like I have Mac PC and the new Visual Studio Code can use to write codes, but is it possible to install the Emulators and SDK for Windows 10 / UWP? I want to build apps for Windows platform. 回答1: Unfortunately currently there is no option to use UWP dev tools on the MAC even with Visual Studio Code. The same is for Linux. 来源: https://stackoverflow.com/questions/39243485/is-it-possible-to-build-uwp-app-in-mac

Calling LoadLibrary using pinvoke from UWP C# application

丶灬走出姿态 提交于 2019-12-05 17:05:35
I'm trying to call methods from an unmanaged dll from a C# UWP application. I do this, but pinvoking "LoadLibrary()" on the unmanaged dll so that I can use it. This all works fine in Debug mode, however in Release mode, I get a curious error: Message: Class Initialization method Tests.UnitTests.InitializeClient threw exception. System.TypeLoadException: System.TypeLoadException: Unresolved P/Invoke method 'LoadLibrary!kernel32' in assembly 'Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it is not available in UWP applications. Please either use an another API , or use

How to print in UWP app?

倾然丶 夕夏残阳落幕 提交于 2019-12-05 16:59:59
问题 I am trying to print out something from my UWP app. Basically I've used a WebViewBrush to draw some data on to some FrameworkElement 's (Windows.UI.Xaml.Shapes.Rectangle) - and I want to print one of these Rectangles on each page (one rectangle per page) I was really hoping someone could provide a very simple example of how printing in UWP works. I have tried it myself and I am happy to provide my code, but there are honestly thousands of lines - all of which I've taken from the Microsoft

Universal Windows 10 WebView - how to clear/disable cache?

别说谁变了你拦得住时间么 提交于 2019-12-05 16:34:44
I am having a lot of trouble clearing the WebView cache in my UWP app. If I edit the content of a JS file linked from my HTML page, I can't get the change into my app unless I re-install the app. The static WebView.ClearTemporaryWebDataAsync() method doesn't seem to work. I have also tried adding headers to the request to disable caching: private void reloadPage() { string url = getUrl(); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, new Uri(url)); request.Headers.Add("Cache-Control", "no-cache, no-store, must-revalidate"); request.Headers.Add("Pragma", "no-cache");