uwp

Windows 10 UWP - detect if the current internet connection is Wifi or Cellular?

人盡茶涼 提交于 2019-12-17 15:43:24
问题 In Windows 10 UWP app how do I detect if the current internet connection is Wifi or Cellular? 回答1: In UWP you can check network connectivity using the IsWlanConnectionProfile or IsWwanConnectionProfile properties. An example would be: var temp = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile(); if (temp.IsWlanConnectionProfile) { // its wireless }else if (temp.IsWwanConnectionProfile) { // its mobile } I hope this helps. 回答2: Other than just getting the

HttpWebRequest in UWP (C#)

99封情书 提交于 2019-12-17 14:54:42
问题 I'm writing code to make HttpWebRequest to website if website is working it will return HttpStatusCode.OK if not it will return HttpStatusCode.NotFound My code var url = "http://simplegames.com.ua/"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if (response.StatusCode == HttpStatusCode.OK) { Debug.WriteLine("All ok"); } else if (response.StatusCode == HttpStatusCode.NotFound) { Debug.WriteLine("URL not

How to render InkCanvas to an image in UWP Windows 10 application?

北城以北 提交于 2019-12-17 12:17:47
问题 The RenderTargetBitmap class worked with simple Canvas + InkManager (in Windows 8.1) to render ink strokes to an image. UWP introduced InkCanvas and a new Inking API. However, it seems like the RenderTargetBitmap does not work with that. When I try to capture ink strokes with RenderAsync method, no ink strokes get rendered only other objects like Rectangle and so on. Is it a bug or this new API is not meant to be used this way? If not, then how can I render an image out of InkCanvas ? Thanks!

How to render InkCanvas to an image in UWP Windows 10 application?

岁酱吖の 提交于 2019-12-17 12:17:09
问题 The RenderTargetBitmap class worked with simple Canvas + InkManager (in Windows 8.1) to render ink strokes to an image. UWP introduced InkCanvas and a new Inking API. However, it seems like the RenderTargetBitmap does not work with that. When I try to capture ink strokes with RenderAsync method, no ink strokes get rendered only other objects like Rectangle and so on. Is it a bug or this new API is not meant to be used this way? If not, then how can I render an image out of InkCanvas ? Thanks!

Can't see localhost from UWP app

怎甘沉沦 提交于 2019-12-17 10:42:56
问题 I’m working on UWP app on my laptop. On a previous laptop with a pre-release Windows 10, I was able to get my app to see my web API service on localhost, but on this laptop, no matter what I try, I always get this error using HTTP client: A connection with the server could not be established var response = await client.GetAsync(BuildGetRequest()).AsTask(source.Token); If I point to my published service on Azure, everything works fine. Here’s what I have tried: Allowed local network loopback

Difference between .Net Core, Portable, Standard, Compact, UWP, and PCL?

孤人 提交于 2019-12-17 10:16:09
问题 I've heard of .Net Core .Net Portable .Net Standard .Net Compact Universal Windows Platform Portable Class Libraries All of these were explained to me as "a subset of the full .Net that allows you to target multiple platforms" . So my questions are What's the difference!? If I want to write a library that's usable to as large an audience as possible, which one (or more than one) of these do I need to use? (My specific situation: I have a library that targets .Net 2.0, .Net 4.5, and UWP.

How to use Acrylic Accent in Windows 10 Creators Update?

僤鯓⒐⒋嵵緔 提交于 2019-12-17 07:07:13
问题 I can't find any detailed document to use Acrylic Accent (CreateBackdropBrush). I found a post in StackOverflow which is somewhat useful but it doesn't help to get started. So please create a detailed answer to this post so that everyone can learn. Update: Microsoft has released an official Acrylic material document Note: If anyone doesn't know about Acrylic Accent. Acrylic Accent is the new feature in Windows 10 Creators Update that allows the app background to be Blurred and Transparent.

How to scroll to element in UWP

只愿长相守 提交于 2019-12-17 06:44:20
问题 How can I scroll to specific position inside a scrollviewer? <ScrollViewer x:Name ="MyScrollView" HorizontalScrollBarVisibility="Hidden" Height="500"> <StackPanel x:Name="ContentsPanel"> <TextBlock x:Name="someTb" Height="50"> </TextBlock> <TextBlock x:Name="otherTb" Height="100"> </TextBlock> </StackPanel> </ScrollViewer> I am trying to scroll to a specific element in my scrollviewer but I am new to UWP and I can't quite get it right how to do it. I want to set the scroll position of

Windows 10 ScrollIntoView() is not scrolling to the items in the middle of a listview

早过忘川 提交于 2019-12-17 06:38:47
问题 I have a Listview with 20 items in it. I want to scroll the Listview programmatically. ListView?.ScrollIntoView(ListView.Items[0]) will scroll the listview to the first item. ListView?.ScrollIntoView(ListView.Items.Count - 1) will scroll the listview to the bottom of the page. However, I am unable to use the same function to scroll the listview to an item in middle. Eg: ListView?.ScrollIntoView(ListView.Items[5]) should scroll and take me to the 5th item of the list. But instead its taking me

UWP Enable local network loopback

好久不见. 提交于 2019-12-16 22:48:15
问题 I wrote a UWP-App and after generating and installing the .appxbundle, every time I start the App I get a net_http_client_execution_error . The App is starting and running fine, when started in Visual Studio 2015. So there is no chance for me to get the problem, if I debug the app. Update: By default Windows restricts apps to reach the localhost (127.0.0.1). I have running a couch database there. This couch database should run there for our costumers as well. Is it possible to allow a App to