uwp

How to print PDF in UWP without loosing quality after rasterization to PNG

谁说胖子不能爱 提交于 2019-12-21 05:16:09
问题 After some investigation of printing in UWP I've highlighted: No native way to print PDF document directly from your app without redirecting this task to Edge or other similar program. There is a way to print XAML Elements (Image for example) using PrintDocument . There is a native way to render PDF into PNG using PdfDocument class These three points gives us ability to print a PDF, but we have a problem here: After rasterization to PNG the quality of output document is quite poor.

Connecting two local uwp Apps on same machine

冷暖自知 提交于 2019-12-21 03:21:27
问题 Im trying to let two uwp apps (windows 10 apps) communicate while running on the same machine. The Apps already can communicate when run on different hosts , so the code is working (both apps are enabled to communicate in local and public networks declared in their manifest files). When running on the same host however, the client application is not able to connect to the server. Im using Visual Studio 2015 Community Edition Update 3 for developing. Under ProjectSettings->Debug->Allow local

Override theme resource in the scope of a Page

时光毁灭记忆、已成空白 提交于 2019-12-21 02:38:06
问题 I want to override a theme resource, specifically the SystemAccentColor , in the scope of a specific page. I have successfully done it in application wide scope. But I can't do it for a specific page. XAML in App.xaml (this works fine) <Application.Resources> <ResourceDictionary> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Default"> <Color x:Key="SystemAccentColor">#862E2D</Color> <SolidColorBrush x:Key="SystemControlHighlightAccentBrush" Color="Black"/> <

Changing value of a ThemeResource at runtime does not reflect in other views

拥有回忆 提交于 2019-12-20 10:55:26
问题 I am using custom themedictionary in my UWP app. I change the value of a ThemeResource at runtime. This change is reflected only in the mainview and not the other views. Even if i create a new view after changing the resource's value the new view uses only the intial value of the resource. Is there anything I'm doing wrong? This is how I change my resource's value. (Application.Current.Resources["BackgroundBrush"] as SolidColorBrush).Color = Windows.UI.Colors.Black; My Secondary View's XAML:

How to access Network Share from Raspberry Pi running IoT Core in UWP app

纵饮孤独 提交于 2019-12-20 10:28:03
问题 I have a c# UWP app that I'm intending to run on a Raspberry PI with Windows 10 IoT Core. The problem I have is when I try to connect to a UNC share to copy some files. The network is just a home network with local user credentials, share is on another computer on the same network. When running the app locally I can just use await StorageFolder.GetFolderFromPathAsync(@"\\share\folder"); to connect to the share and this works fine, I'm assuming this is because the credentials I'm using are

Make app icon on task bar have a transparent background (UWA)

依然范特西╮ 提交于 2019-12-20 10:26:09
问题 I am making a Universal Windows App and I want my apps icon on the task bar to have a transparent background so it isn't in a coloured box. A lot of Microsoft's own stock apps are like this (Mail, Photos, Xbox etc) and I know it can be done because I did it by accident. But the icons I was using were too big and when I used correct sized ones it stopped working. I've tried using the old too large icons again and it still doesn't work. Setting the tile background in the apps manifest just

Reflection in universal windows platform (UWP) missing properties

血红的双手。 提交于 2019-12-20 09:55:52
问题 Type t = obj.GetType(); t.IsEnum; t.IsPrimitive; t.IsGenericType t.IsPublic; t.IsNestedPublic t.BaseType t.IsValueType All of the above properties are missing in UWP. How do I check for these types now? 回答1: A C# app that targets UWP uses two distinct sets of types. You already know the .NET types, like System.String, but the UWP specific types are actually COM interfaces under the hood. COM is the super-glue of interop, the basic reason why you can also write UWP apps in Javascript and C++.

UWP compiled binding x:Bind produces memory leaks

烂漫一生 提交于 2019-12-20 09:55:15
问题 While developing UWP application I recently found quite a few memory leaks preventing my pages from being collected by GC. I have a ContentPresenter on my page like: <ContentControl Grid.Column="0" Grid.Row="1" Content="{x:Bind ViewModel.Schedule, Mode=OneWay}"> </ContentControl> After I remove the Content, or replace it with dynamic {Binding} -- page is collected when I navigate from it. Otherwise it remains in memory. Is it bug or I'm doing something wrong? Is there a way to release and

UWP Windows 10 App memory increasing on navigation

女生的网名这么多〃 提交于 2019-12-20 09:45:24
问题 I have a UWP Windows 10 App and noticed the memory usage in task manager is increasing over time. I stripped the App back and found the memory is increasing when the navigating pages. So I made a simple app with just a few pages to test and the memory is still increasing in this simple App. I have a MainPage that navigates a frame from Page1 to Page2 and back on a timer. public sealed partial class MainPage : Page { private DispatcherTimer _timer; private bool _page1Showing; private bool

StreamReader doesn't take string?

江枫思渺然 提交于 2019-12-20 07:27:12
问题 I'm trying to read a file with a StreamReader, but I get an error for using path Argument 1: cannot convert from 'string' to System.IO.Stream even though it's clear from the documentation, that you should be able to use a string. What am I missing here? public MyClass Load(String path) { try { // exception in this line, `path` is underlined with red using (StreamReader reader = new StreamReader(path)) { String line = reader.ReadLine(); // ... etc 回答1: I can't tell if you got your answer or