uwp

HidDevice.FromIdAsync returns null with readwrite

╄→尐↘猪︶ㄣ 提交于 2019-12-04 14:26:49
I am trying to port a library from classic desktop to UWP. It all works like planned except for one thing. When I try to open a HID connection to the device(A wiimote) it won't connect if the permissions are on readwrite. It does work with read only permissions. What could be the problem. The permissions in the manifest are set to the correct values. EDIT: I checked the DeviceAccessStatus to see if the permissions are not good but it returns DeviceAccessStatus.Allowed Manifest code <Capabilities> <Capability Name="internetClient" /> <DeviceCapability Name="humaninterfacedevice"> <Device Id=

Drawing editable and selectable shapes with Win2D?

这一生的挚爱 提交于 2019-12-04 13:33:12
I've used System.Windows.Shapes before to add Shapes to Canvas -controls. They can be used like objects and the visuals change as I edit the fields. I can also add event handlers for clicks etc. I'd need this kind of functionality by using Win2D . Is there any easy way? I'm trying to create a simple app like this: User can draws shapes to canvas Shapes can be selected and highlighted by clicking Selected shapes's can be manipulated (color, opacity, width, height, position etc) Shapes can be layered over each other (Z-index) I guess one way would be to create custom Shape classes with Draw

restart via code on windows 10 uwp

烂漫一生 提交于 2019-12-04 13:05:48
We've created a Windows 10 application that runs on tablets in Windows 10 kiosk mode. It works just fine, however, the wifi connection gets lost sometimes since the locations are very remote. We tried fixing the issue from the networking side, but when the devices lose and regain internet access the application will still hang as if it doesn't have internet access displaying a blank page. Where these devices are used, they are bolted into the wall to prevent theft. Which means if we want to reboot its very time consuming as we have to unscrew the cases off the wall and then open the cases to

NTLM authentication using Windows.Web.Http.HttpClient

泄露秘密 提交于 2019-12-04 13:01:59
I am working on a Windows 10 UWP app that needs to talk to a IIS server using NTLM authentication. I am setting the username and password in the HttpBaseProtocolFilter: filter.ServerCredential = new PasswordCredential(uri, UserName, Password); When i view the request in fiddler, it is using Basic Auth. Is there anything I can do to get it to use NTLM, which the server is requiring? Request Headers: Content-Length: 1459 Content-Type: text/xml; charset=utf-8 Host: server Connection: Keep-Alive Cache-Control: no-cache Cookie: ClientId=XXXXXXXXX Authorization: Basic XXXXXXXXX Response Headers:

How does x:Bind compare with the classical Binding, put as concisely as possible?

邮差的信 提交于 2019-12-04 12:34:58
How is the compiled binding, x:Bind, different from the classical Binding, put as concisely as possible? Compared with the classical binding you cannot use the following binding attributes with x:Bind : ElementName , RelativeSource , Source and UpdateSourceTrigger . Well, that almost sums up the limitations of x:Bind but x:Bind is powerful in its own right -- the notable one being compiled binding and hence the performance gain as a result. See last bullet point for another powerful thing in x:Bind 's armory. One important point to always remember: the data context of x:Bind is the code-behind

XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'Microsoft.Win32.Registry.dll'

牧云@^-^@ 提交于 2019-12-04 12:14:05
问题 I upgraded my UWP Project to Fall Creator Update with the Windows SDK 10.1.16299.15. When I compile or create a Store Package I get: C:\Users...\Visual Studio 2017\Projects\FileRenamer\Get.the.solution.FileRenamer.App\Get.the.solution.FileRenamer.App.csproj : XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'Microsoft.Win32.Registry.dll' 3>C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(263,5): Xaml

Download and save a picture from a url Universal windows app

时间秒杀一切 提交于 2019-12-04 12:10:17
I am using the below code to downlaod the picture form a remote url and save to Local storage folder try { var rootFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync( "MyAppName\\CoverPics", CreationCollisionOption.OpenIfExists); var coverpic_file = await rootFolder.CreateFileAsync(filename, CreationCollisionOption.FailIfExists); try { var httpWebRequest = HttpWebRequest.CreateHttp(coverUrl); HttpWebResponse response = (HttpWebResponse)await httpWebRequest.GetResponseAsync(); Stream resStream = response.GetResponseStream(); using (var stream = await coverpic_file.OpenAsync

Flyout or Popup to display addition info

情到浓时终转凉″ 提交于 2019-12-04 12:09:56
I want display popup on top my app with additional information, my info is Listview with ~500 items I've tried both: problem with flyout -> it has probably scrollViewer inside so my listview doesn't Virtualize correctly everything else is ok. There is my code: Flyout myFlyout = new Flyout(); myFlyout.Placement = FlyoutPlacementMode.Full; myFlyout.Content = myListView; myFlyout.ShowAt(this); problem with popup -> it isn't centered, verticalAlignment doesn't work, horizontal neither Popup myPopup = new Popup(); myPopup.Child = myListView; myPopup.IsOpen = true; So which way should I go, try to

How to reference a UserControl from an external class library (through a NuGet Package)?

Deadly 提交于 2019-12-04 12:06:19
Is it possible to reference and use a UserControl in UWP app project that resides in a UWP class library? I tried creating a UserControl in a class library but when I try to use it in the app I get: An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in App1.exe but was not handled in user code WinRT information: Cannot locate resource from 'ms-appx:///ClassLibrary1/MyUserControl1.xaml'. [Line: 10 Position: 6] Edit: Sample Page where I'm trying to use the MyUserControl1: <Page x:Class="App.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x

Universal Windows (UWP) Range Slider

此生再无相见时 提交于 2019-12-04 11:38:09
I want to create range slider in UWP . I didn't find any example. There are only single sliders but I want it like . Does anybody know how can i do it? Please help me. To create a range slider in UWP, we can create a custom control or use UserControl . Here I use UserControl for example: Firstly, I add a UserControl named "MyRangeSlider" in my project. In the XAML: <UserControl x:Class="UWP.MyRangeSlider" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns