windows-10-universal

UsbDevice.FromIdAsync returns null

主宰稳场 提交于 2019-12-23 17:03:12
问题 I have this code: private async void OnDeviceAdded(DeviceWatcher watcher, DeviceInformation deviceInformation) { if (deviceInformation.Name.StartsWith("ClearShot") && deviceInformation.IsEnabled) { targetDevice = await UsbDevice.FromIdAsync(deviceInformation.Id); OnConnected(EventArgs.Empty); } } This is actually an event that is called from a DeviceWatcher The problem is that targetDevice is always null. No crashes no nothing, It's just null, doesn't change. Why ? Edit: This is the thing

Drag and Drop in UWP in list of bank accounts

二次信任 提交于 2019-12-23 10:13:11
问题 I have a Universal Windows Application for a local bank, I'm working on a money transfer view, and they need to transfer money from account to account using the Drag and Drop feature in UWP applications. I've made the animation part, but I need help after I drop the list item to the "Account To" list. I'll attach a screenshot to make it clear. As you see in the picture, I need to drag one item from the "From Account" list and drop it on only one item on "To Account" list. How can I achieve

WebView - Define User-Agent on every request

不打扰是莪最后的温柔 提交于 2019-12-23 08:06:16
问题 Currently, I am setting the User-Agent of a request message as follows: var rm = new HttpRequestMessage(HttpMethod.Post, new Uri("http://example.com")); rm.Headers.Add("User-Agent", "UserAgentString"); webView.NavigateWithHttpRequestMessage(rm); Everything works as expected. But, when I am navigating to an another page, by clicking a link on the site for example, the User-Agent resets to the default of the WebView . Is there any way of setting the User-Agent permanently or changing it on

WebView - Define User-Agent on every request

自闭症网瘾萝莉.ら 提交于 2019-12-23 08:05:07
问题 Currently, I am setting the User-Agent of a request message as follows: var rm = new HttpRequestMessage(HttpMethod.Post, new Uri("http://example.com")); rm.Headers.Add("User-Agent", "UserAgentString"); webView.NavigateWithHttpRequestMessage(rm); Everything works as expected. But, when I am navigating to an another page, by clicking a link on the site for example, the User-Agent resets to the default of the WebView . Is there any way of setting the User-Agent permanently or changing it on

How to resize Webview height based on HTML content in Windows 10 UWP?

落花浮王杯 提交于 2019-12-23 07:00:10
问题 I am currently working on Windows 10 UWP App and facing an issue with WebView that when I have less HTML content, I am getting more height in javascript. My Code is as follows WebView webView = new WebView() { IsHitTestVisible = true }; string notifyJS = @"<script type='text/javascript' language='javascript'> function setupBrowser(){ document.touchmove=function(){return false;};; document.onmousemove=function(){return false;}; document.onselectstart=function(){return false;}; document

Grouping ListView under PivotItem in Windows 10 UWP

拟墨画扇 提交于 2019-12-23 05:18:08
问题 I am currently working on grouping Listview based on billing_id in my case. I am proper able to retrieve group by items using GroupBy of LINQ, but I am facing issues while displaying it. It displays as an entire page and not as a child of PivotItem. My code is as the following. First I created a CollectionViewSource in Page resources as follows <Page.Resources> <CollectionViewSource x:Key="cvs" x:Name="cvs" IsSourceGrouped="True" /> </Page.Resources> Then I retrieved all the list using

Unable to access local Web API from Visual Studio 2015 WIndows 10 Phone Emulator

泪湿孤枕 提交于 2019-12-23 05:11:25
问题 I'm currently developing a UWP phone app which calls a Web API. When using the Visual Studio 2015 (Update 3) mobile emulators, calls to the Web API work fine for emulator versions 10.0.10240.0 and 10.0.10586.0. However, for the latest emulator versions 10.0.14393.0 my API calls all fail. The http address I'm using to access the Web API, which is running under IIS Express, is http://localhost:64210 . Using the emulator's browser, I can access this URL in 10240/10586, but not 14393. I've tried

flipView and Page indicator UWP

故事扮演 提交于 2019-12-23 05:06:05
问题 I am facing a problem in synchronising the FlipView with the Page Indicator,this is my code: <Grid> <FlipView x:Name="flipView1"> <FlipView.ItemTemplate> <DataTemplate > <Grid Background="Transparent"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Button Grid.Column="0" Grid.Row="0"> <Image Source="{Binding Image}"/> </Button> </Grid> </DataTemplate> </FlipView.ItemTemplate> <

Getting SPI temperature data from outside of class

痞子三分冷 提交于 2019-12-23 02:51:03
问题 I'm trying to write a class "Temperature" that handles communicating with my RaspberryPi through SPI to read some temperature data. The goal is to be able to call a GetTemp() method from outside of my Temperature class so that I can use temperature data whenever I need it in the rest of my program. My code is set up like this: public sealed class StartupTask : IBackgroundTask { private BackgroundTaskDeferral deferral; public void Run(IBackgroundTaskInstance taskInstance) { deferral =

Show icon on SecondaryCommands (UWP)

安稳与你 提交于 2019-12-23 02:38:35
问题 I set the icons in my SecondaryCommand of CommandBar but aren't shown. Why? <CommandBar RelativePanel.AlignRightWithPanel="True" RelativePanel.AlignVerticalCenterWithPanel="True" Margin="0"> <CommandBar.SecondaryCommands> <AppBarButton Name="shareButton" Label="Condividi" x:Uid="condividi" Click="shareButton_Click" Icon="ReShare" /> <AppBarButton Name="contactButton" Icon="Contact" x:Uid="contatti" Label="Contatti" Click="contactButton_Click" /> </CommandBar.SecondaryCommands> </CommandBar>