uwp

How to bind to attached property in UWP?

喜欢而已 提交于 2019-12-10 14:22:46
问题 I need to bind a property of a control to an attached property in XAML (so that the attached property becomes a source of the binding), and I can't figure out how to do it -- VS2015 gives me " Value does not fall within the expected range " error, and when I run the app, I get an exception. The technique shown below worked perfectly in WPF. Here is the sample app demonstrating the problem. AttachedPropertyTest.cs: namespace App7 { public static class AttachedPropertyTest { public static

How to consume duplex wcf service in Windows Universal App

江枫思渺然 提交于 2019-12-10 14:19:51
问题 How can I consume wcf service with duplex contract in Windows universal app? I'm getting PlatformNotSupportedExcetpion: Operation is not supported on this platform. runtime exception when trying to consume duplex wcf service in Windows Universal App, targeting Windows 10 (10.0; Build 10240) According msdn it is supported API. If it is not possible, how should I proceed in my scenario? I have two applications (console and windows universal xaml app) running on the same machine and I need two

Fetching WiFi adapters list in Windows 10 app fails

三世轮回 提交于 2019-12-10 13:58:21
问题 I have a Windows 10 universal app and I am trying to get the list of WiFi adapters: var adapters = await WiFiAdapter.FindAllAdaptersAsync(); I have all the required permissions set up. This calls works once. Then when I close or kill the app, the call fails with An attempt was made to establish a session to a network server, but there are already too many sessions established to that server. (Exception from HRESULT: 0x800704C4) The error message is strange, I do not know how to interpret or

How to receive simplest Windows message on UWP XAML MVVM app?

元气小坏坏 提交于 2019-12-10 13:38:45
问题 My big-picture problem: I need to send a signal from a Windows 10 desktop app (or a service, really) to a UWP XAML MVVM app on the same OS instance / machine. I was using named semaphores in the global namespace, but these don't work at all on UWP (by design, for security reasons maybe). No joy. I tried UWP sockets, and this works with the UWP as listener only if the client is on a remote machine. Is this a security design decision, too? No idea. Exempting the app from loopback restriction

SettingsPane not found in Windows 10 build

你离开我真会死。 提交于 2019-12-10 12:55:59
问题 I am building a new Windows 10 UWP (Universal Windows Platform) app using Visual Studio 2015. Actually I am porting my Windows 8.1 app, but I did so by creating a whole new project and manually pulling in each class. My app is failing to build with the following error: The type or namespace name 'SettingsPane' could not be found (are you missing a using directive or an assembly reference?) The C# file in question does have a using statement for Windows.UI.ApplicationSettings , and I also get

How to wait for WebViewBrush.Redraw() to finish (UWP printing)?

亡梦爱人 提交于 2019-12-10 12:55:19
问题 I have a basic UWP app with an embedded WebView presenting a rather large HTML document (up to 500 letter-sized printed pages). I'd like to add support for printing that HTML document. Here is my approach: To support pagination, I generate a second HTML document broken into "pages" by using a <div style="height:100vh"> for each "page", up to 500 of these. I load that "paginated" HTML into a second, hidden WebView on the XAML page that I resize to fit exactly one page based on the user

How to overlay items in StackPanel or ListView?

主宰稳场 提交于 2019-12-10 12:49:13
问题 I am making a card game and I want to display cards in player's hand half-covered be each other. How can I do that using ListView or StackPanel? Here is an example how I would like to display player hand. <Grid Background="Green" > <Image x:Name="One" Width="100" Height="100" Margin="10,10,250,210"/> <Image x:Name="Two" Width="100" Height="100" Margin="10,10,210,210"/> </Grid> UPDATE I set margins for ListView's ItemContainerStyle and it worked, but I have another problem. Width of ListView

How to create a MediaClip from RenderTargetBitmap in an efficent way?

ⅰ亾dé卋堺 提交于 2019-12-10 12:48:35
问题 I am trying to capture a video of a XAML grid in UWP app using c#. My approach. 1.Use RenderTargetBitmap to take a screenshot using renderTargetBitmap.RenderAsync 2.Convert the data to byte array. 3.Create an image file with the bytes and save it on disk using BitmapEncoder 4.Create a MediaClip from that image using MediaClip.CreateFromImageFileAsync 5.Add the clips to a MediaComposition composition.Clips.Add(clip) 6.Save as a video using composition.RenderToFileAsync(video); Now this

Reference a .NETStandard 2.0 project from UWP project

浪尽此生 提交于 2019-12-10 12:44:59
问题 I am building a Xamarin application, and I have implemented the core (using Xamarin.Forms) in a .NETStandard 2.0 class library. It is correctly referenced by an iOs and Android project which implements the platform-specific code. The problem is, I tried to add an UWP project in order that my app supports UWP, and when I try to reference the core project, I have the following error: Project [Core project] is not compatible with uap10.0.10586 (UAP,Version=v10.0.10586) / win10-x86-aot. Project

Post Stream in ASP.NET Core Web Api

别等时光非礼了梦想. 提交于 2019-12-10 12:40:02
问题 Hello lovely people of Stack Overflow. Since yesterday I have a problem and I have been browsing SO since then. I have a UWP Client and ASP.NET Core Web Api. I just want to send a stream to my web api but indeed this occurred to be harder task than i thought. I have a class which I have only one property. The Stream property as you can see below: public class UploadData { public Stream InputData { get; set; } } Then Here is my code from my Web Api: // POST api/values [HttpPost] public string