uwp

UWP - How Can Dispatcher DispatchedHandler Run On Worker Thread?

你。 提交于 2021-02-11 14:17:03
问题 Im trying to update some UWP UI from a background thread via the Dispatcher. However, the handler passwed to the RunAsync method is still getting executed on a backlground thread. I have no idea how to fix this - have I missed something? --EDIT-- I only have one window, which is Window.Current I have tried the Community Toolkit DispatcherHelper class, but I'm still getting the exact same exception private static async void OnSelectedItemChanged(DependencyObject d,

confused by Windows Run Time Component Directories and which .winmd file do I need to add

时间秒杀一切 提交于 2021-02-11 13:46:34
问题 I create a WindowsRuntimeComponent3 solution, batch build then VS create a series directories as below, there are WindowsRuntimeComponent3.winmd in these different directories. just wonder which WindowsRuntimeComponent3.winmd do I need to add? if them one by one, it will report error your comment welcome 回答1: You add a reference to the project directly, and VS will take care of the CPU architecture and build flavour for you; you shouldn't need to look in those specific directories. When you

confused by Windows Run Time Component Directories and which .winmd file do I need to add

孤街醉人 提交于 2021-02-11 13:45:01
问题 I create a WindowsRuntimeComponent3 solution, batch build then VS create a series directories as below, there are WindowsRuntimeComponent3.winmd in these different directories. just wonder which WindowsRuntimeComponent3.winmd do I need to add? if them one by one, it will report error your comment welcome 回答1: You add a reference to the project directly, and VS will take care of the CPU architecture and build flavour for you; you shouldn't need to look in those specific directories. When you

The TargetType for Line in style doesn't work in UWP

拟墨画扇 提交于 2021-02-11 13:38:11
问题 I have the following code: <Grid> <Grid.Resources> <Style TargetType="Line"> <Setter Property="Stroke" Value="Black"></Setter> <Setter Property="StrokeDashArray" Value="3"></Setter> <Setter Property="StrokeThickness" Value="3"></Setter> </Style> </Grid.Resources> <Line X1="20" X2="500" Y1="50" Y2="50"></Line> <Line X1="20" X2="500" Y1="100" Y2="100"></Line> <Line X1="20" X2="500" Y1="150" Y2="150"></Line> </Grid> You could see the screenshoot, the StrokeDashArray property value in the style

Windows.ApplicationModel does not exist, why?

柔情痞子 提交于 2021-02-11 13:33:03
问题 I met an UWP issue, and asked question as below post: How to detect user idle in UWP? Thanks for Nico to answer my question! And he provided an example code here: https://stefanwick.com/2018/05/15/global-hotkey-registration-in-uwp/ https://github.com/StefanWickDev/ExtensionGallery/tree/master/GlobalHotkey Some of the codes which report compile errors are: using Windows.ApplicationModel; using Windows.ApplicationModel.AppService; using Windows.ApplicationModel.Core; using Windows.Foundation

why does x:Bind expect a static method to bind to?

混江龙づ霸主 提交于 2021-02-11 12:22:35
问题 I have a UWP MVVM application where I bind, amongst others, the following property to a DataGridComboBoxColumn : public List<ComboBoxValues> ListValues { get; set; } = new List<ComboBoxValues>(); XAML: xmlns:local="using:MyProject.ViewModels" <controls:DataGridComboBoxColumn Header="myHeader" Binding="{Binding theSelectedValue, Mode=TwoWay}" ItemsSource="{x:Bind local:PageVM.ListValues, Mode=OneWay}" DisplayMemberPath="theValueOptions"/> I use dependency injection, using Autofac to generate

How to launch win32 executable desktop with 4 arguments from UWP project

最后都变了- 提交于 2021-02-11 12:13:47
问题 I'm using UWP project to launch an win32 apps developed with Qt, but I need to pass some parameters (args). If I launch (.exe) without parameters it works. I'm a beginner in UWP Thanks for your help. I've tried to use this code but was not succesful. ApplicationData.Current.LocalSettings.Values["Parameters"] = tbParameters.Text; await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Parameters"); //Parameters 回答1: Assuming I understand your question correctly, please have a

How to launch win32 executable desktop with 4 arguments from UWP project

Deadly 提交于 2021-02-11 12:10:56
问题 I'm using UWP project to launch an win32 apps developed with Qt, but I need to pass some parameters (args). If I launch (.exe) without parameters it works. I'm a beginner in UWP Thanks for your help. I've tried to use this code but was not succesful. ApplicationData.Current.LocalSettings.Values["Parameters"] = tbParameters.Text; await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Parameters"); //Parameters 回答1: Assuming I understand your question correctly, please have a

Binding DataTemplate's datacontext property to a usercontrol dependency property

这一生的挚爱 提交于 2021-02-11 08:09:18
问题 In a UWP application, i have a Listview with a datatemplate. The ListView is binded via ItemsSource to an ObservableCollection of my model. <ListView SelectionMode="None" ItemTemplate="{StaticResource MydataTemplate}" ItemsSource="{Binding Meals, Mode=OneWay}" Meals is the ObservableCollection of model Meal : public class Meal { public string restaurantId { get; set; } public double price { get; set; } public int Quantity { get; set; } = 0; } Inside ListView DataTemplate, i have a User

Binding DataTemplate's datacontext property to a usercontrol dependency property

扶醉桌前 提交于 2021-02-11 08:07:14
问题 In a UWP application, i have a Listview with a datatemplate. The ListView is binded via ItemsSource to an ObservableCollection of my model. <ListView SelectionMode="None" ItemTemplate="{StaticResource MydataTemplate}" ItemsSource="{Binding Meals, Mode=OneWay}" Meals is the ObservableCollection of model Meal : public class Meal { public string restaurantId { get; set; } public double price { get; set; } public int Quantity { get; set; } = 0; } Inside ListView DataTemplate, i have a User