uwp

[UWP][C#]Display binding text in webview in listbox

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:37:30
问题 I have a webview in the listbox to display some options in the form of data bindings from the database (the number of options displayed according to the number of options in the database). I use webview because the answer option exists that contains the tag. Database: XAML: <ListBox Name="ListOption" Grid.Row="4" xmlns:m="using:KipinATM_Win10.Tryout.Models" SelectionChanged="ListAlternatives_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate x:DataType="m1:DBOPTION"> <StackPanel

Using Roslyn scripting in UWP

☆樱花仙子☆ 提交于 2019-12-11 16:32:54
问题 I have the following segment of code. var script = CSharpScript.Create("int x = 12;"); var result = await script.RunAsync(); var variable = result.GetVariable("x"); int value = (int)variable.Value; It crashes on the second line with following: Could not load file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) This is a UWP

Application.Current.Dispatcher.Invoke UWP analog

爷,独闯天下 提交于 2019-12-11 16:31:58
问题 Which is an analogue of Application.Current.Dispatcher.Invoke (such as WPF) exists in UWP? Application.Current.Dispatcher.Invoke(() => { //some code here }); 回答1: Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // Do your stuff here }); This will run your code on the UI thread, change the CoreDispatcherPriority.Normal to your liking. 来源: https://stackoverflow.com/questions/54886699/application-current-dispatcher

WinIot Core v.10.0.16299.15 - RP3 - Microsoft Visual Studio Remote Debugger, MSVSMON not running

血红的双手。 提交于 2019-12-11 16:29:38
问题 This isnt my first project with WinIoT on a Pi. I have been using the WinIot image since its first version. I decided to update all my Pis to the latest WinIoT image. My VS is updated to the latest version 2017 15.15.2. When I go to remote debug my application, It fails during the deploy process with this error: 1>Error: Unable to connect to the Microsoft Visual Studio Remote Debugger named '[iphere]'. The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running on the

BarcodeScanner.GetDefaultAsync() is always returning null

烂漫一生 提交于 2019-12-11 16:25:41
问题 I'm trying to create a simple application in UWP for a Zebra device (Model TC700J) running Windows 8, in which I make use of the built in barcode scanner. From what I've found, there's plenty of Zebra tutorials for accessing the scanner when programming on Android, but none for Windows due to the fact that Microsoft provide their own generic barcode scanner API found in the Windows.Devices.PointOfService namespace. The code I currently have looks something like this: BarcodeScanner scanner;

Multiple ToggleSwitch instances get same data from the List (ListView) using C# in UWP

淺唱寂寞╮ 提交于 2019-12-11 16:21:57
问题 This is my first experience with ToggleSwitch. What I am trying to achieve is to show different data from the list using different ToggleSwitches. I have a ListView with multiple TextBlocks and one ToggleSwitch for each row of data. Then I populate ListView with data from List. (List is populated using class that forsees public ToggleSwitch Switch {get; set;} Here is how I try to get ToggleSwitch data from each row: private void ToggleSwitch_Toggled(object sender, RoutedEventArgs e) { for

UWP FileOpenPicker locks\freezes app in debug

霸气de小男生 提交于 2019-12-11 16:13:57
问题 If the debugger is attached, calling this function causes the app to hang. If I run without a debugger, there is no hang, and file pickers work perfectly. private async void OnClick(object sender, RoutedEventArgs e) { FileOpenPicker openPicker = new FileOpenPicker(); } I'm certain this is something super simple, but I just don't know. Edit: Here's how I'm using it. Keep in mind, that the simpler function creates the hang issue without all my extra code after it. I've stuffed up the image

Xamarin Forms ListView SelectedItem Binding Issue

人盡茶涼 提交于 2019-12-11 16:13:45
问题 ListViews follow the ItemPicker/Selector pattern of UI controls. Generally speaking, these types of controls, regardless of their platform will have a SelectedItem, and an ItemsSource. The basic idea is that there is a list of items in the ItemsSource, and the SelectedItem can be set to one of those items. Some other examples are ComboBoxes (Silverlight/UWP/WPF), and Pickers (Xamarin Forms). In some cases, these controls are async ready, and in other cases, code needs to be written in order

In UWP, what is the equivalent of DependencyType property of DependencyProperty Class of WPF?

我是研究僧i 提交于 2019-12-11 16:13:34
问题 After migrating a WPF class library to a UWP class library, the following code is throwing an error. The PropertyType property of DependencyProperty class worked in WPF. I tried to get help from Dependency properties overview of similar class in UWP and this online article but got a bit confused. What I'm missing here and how can I make it work? Code snippet [error occurs at first line of the method]: using Windows.UI.Xaml; using System.Reflection; using Windows.UI.Xaml.Documents; using

Problem in sending a Toast message in UWP using c#

做~自己de王妃 提交于 2019-12-11 16:06:18
问题 I am sending a toast message using a background task in a UWP application. The code is successfully getting executed but it isn't sending the toast message. I tried many ways but none of them is working. This is for a UWP application. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; using Windows.ApplicationModel.Background; using Windows.UI.Notifications; namespace