uwp

How can I debug XAML designer issues?

旧时模样 提交于 2019-12-07 09:08:21
问题 I'm developing a UWP app with Visual Studio 2015, and one of the things I want to do use some sample data at design time. Now, I've added a XAML file, set the build action as DesignDataWithDesignTimeCrateableTypes My XAML is really straight forward here: <local:Freead xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MyNamespace.Uwp.Windows.ViewModels" xmlns:ad="clr-namespace:MyNamespace

How to properly enable dpi-scaling on uwp app

你离开我真会死。 提交于 2019-12-07 09:05:50
问题 I've created my first UWP app. It's a Windows 8.1 UWP app which will help with scheduling courses at my university who's current system is awful. I've been working on it with my Windows 10 desktop computer with a 1080p monitor at default system scaling (100%). I deployed a test build and installed it on my laptop. The laptop is also Windows 10 and 1080p but has a smaller screen so I have system scaling set to 125%. My problem is that instead of this higher scaling factor making my app have

XBF Error with DataTemplate in Application.Resources

好久不见. 提交于 2019-12-07 08:49:03
问题 Universal Windows Platform app with Visual Studio 2015 (RTM) I have a DataTemplate that is used in multiple pages of my app, so I'd prefer to write it once and access it from anywhere I need to. In order to make it accessible by any page, I write it in my App.xaml 's <Application.Resources> : <Application x:Class="MyApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:MyApp" xmlns:viewmodels="using

SerialDevice.FromIdAsync() yields a null serial port

人走茶凉 提交于 2019-12-07 08:43:55
问题 I have something strange happening with my code when trying to connect to a serial port. When using Serial Sample, everything works just fine and it connects on the first try. However, with my code the serial port returns a null. I have found a workaround by nested the call to write the serial port in a do loop until the serial port is no longer null and it works. It takes, on average, 500 loops to connect and it has always connected. I know it's dangerous because there is the infinite loop

Binding a UserControl DP from DataTemplate UWP

本秂侑毒 提交于 2019-12-07 08:34:14
问题 I've got a FlipView that shows Figurines . Figurines contain a Path to their image. Binding this property to a regular DataTemplate is ok. (the code below works fine) </DataTemplate> <Canvas x:Name="DefaultImageCanvas" Width="660" Height="372"> <Image Name="imageFlip" Width="660" Height="372" Source="{Binding Path}" Stretch="Uniform" /> </Canvas> </DataTemplate> But when using my UserControl instead, it doesnt work anymore: <DataTemplate> <local:FigurineStickerUserControl Width="660" Height=

Bitmap smoothing in UWP

末鹿安然 提交于 2019-12-07 08:06:07
问题 I am trying to figure out how to resize an image without losing quality in UWP. I know in WPF there's an option to smooth an image using this: RenderOptions.BitmapScalingMode="HighQuality" but I can't seem to find an equivalent in UWP. Here's what the image looks like: And what it's supposed to look like: If you look closely, you can see that the picture is badly pixelated. How can I achieve this in UWP? I'm resizing it by XAML (circle crop): <Ellipse x:Name="personImageContainer" Width="50"

How to debug an UWP app in Release mode + “.Net Native tool chain”

走远了吗. 提交于 2019-12-07 07:58:54
问题 I have developed an UWP app that works globally fine, but I encounter some problems with the Store app, or with the Release build, whereas all works fine in Debug build... The app seems very basic: ts allows users to create and sync forms through webservices. At the launch of the app, a test is done to see if a user is already logged in: if it's not the case, the app navigates to the " Login " page, otherwise it navigates to the " Home " page, which contains the forms list. Then the user can

How to invoke javascript in WebView Windows 10 UWP?

南笙酒味 提交于 2019-12-07 07:48:28
I am trying to load a javascript in WebView to do some calculations and get the output in a string. I tried to use following code string htmlFragment = "<html><head><script type='text/javascript'>" + "function doubleIt(incoming){ " + " var intIncoming = parseInt(incoming, 10);" + " var doubled = intIncoming * 2;" + " document.body.style.fontSize= doubled.toString() + 'px';" + " return doubled.toString());" + "};" + "</script></head><body>" + "<div id = 'myDiv'>I AM CONTENT</div></body></html>"; htmlView.NavigateToString(htmlFragment); htmlView.LoadCompleted += async(s1,e1) => { string result =

How do I get access to Windows.Storage namespace?

别说谁变了你拦得住时间么 提交于 2019-12-07 07:05:16
问题 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. 回答1: 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

Merged ResourceDictionary initalization in UWP app

孤街醉人 提交于 2019-12-07 06:54:57
问题 During development of my UWP app I have noticed and intersting oddity which I have hard time explaining. I user MvvmLight and I decided to add the ViewModelLocator resource instance in a separate ResourceDictionary Core.xaml which will be referenced from MergedDictionaries in App.xaml . Following is the content of App.xaml : <Application ...> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Resources/Core.xaml" />