uwp

UWP serial port communication for character write and read (UWP and Arduino)

孤街醉人 提交于 2019-12-22 00:20:52
问题 I am using this code but not working and throwing this exception: Object reference not set to an instance of an object devices[0] giving me null value. private async void ConnectToSerialPort() { string selector = SerialDevice.GetDeviceSelector("COM7"); DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selector); if (devices.Count > 0) { DeviceInformation deviceInfo = devices[0]; SerialDevice serialDevice = await SerialDevice.FromIdAsync(deviceInfo.Id); Debug.WriteLine

Universal Windows Platform commanding with parameters [closed]

笑着哭i 提交于 2019-12-22 00:03:17
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . How I can make parameterized commands in Universal Windows Platform without MVVM-frameworks? I was tried to implement RelayCommand class, but System.Windows.Input namespace haven't CommandManager class. 回答1: If you don't want to use a framework, you have to implement the interface System.Windows

Is there a method available for UWP apps to get available disk space

本小妞迷上赌 提交于 2019-12-21 23:17:52
问题 I am working on a UWP app that depends on available storage space, and would like to have that information prior to a save fail. I have tried the RetrievePropertiesAsync calls on the known folders, but do not get a Freespace or Capacity property in the resultant list. Is there a method available for this? Code used to access properties: auto basicProperties = co_await videosFolder->GetBasicPropertiesAsync(); auto retrievedProperties = co_await basicProperties->RetrievePropertiesAsync

Is it possible to use compiled binding (x:Bind) with Relative Source, Templated Parent

夙愿已清 提交于 2019-12-21 22:33:55
问题 I'd like to do something like this is a Style: Value="{x:Bind MyCustomDependencyProp, RelativeSource={RelativeSource TemplatedParent}}" Is that possible? Are there any performance benefits? Using TemplateBinding does not seem to work, with a custom DependencyProperty as described elsewhere here on SO: https://stackoverflow.com/a/8657453 回答1: RelativeSource (with x:Bind) is not supported, therefore this particular scenario won't be possible (at the moment, at least). Using TemplateBinding or

App or Code to Suspend Resume UWP app without Visual Studio

我是研究僧i 提交于 2019-12-21 22:12:05
问题 My question is similar to How to make UWP app to suspend and resume state, but I need an application that I can give to my QA team so that they can more easily invoke Suspend and Resume in my app. Since Visual Studio has a "LifeCycle Events" toolbar that lets you suspend and resume your App, I figure that there must be an app that ships with Visual Studio that does this. However, perusing through the Visual Studio files, I was not able to find such an executable. Does anyone know of a stand

PostAsync throwing IRandomAccessStream error when targeting windows 10 UWP

本小妞迷上赌 提交于 2019-12-21 21:50:49
问题 I'm in the process of porting my windows 8.1 app to windows 10 UWP, but calling PostAsync now throws an exception. This exact code works perfectly when targeting 8.1, but when I target Windows 10 UWP, it throws the following exception: This IRandomAccessStream does not support the GetInputStreamAt method because it requires cloning and this stream does not support cloning. Code public async void TestPost() { var parameters = GetParameters(); var formattedData = new FormUrlEncodedContent

How to change the button's background when mouseover in UWP?

。_饼干妹妹 提交于 2019-12-21 21:48:26
问题 Now I only want to change the button's background to #f5f5f5 when mouseover it. WPF has a trigger function which can do it easily. Whereas I heard that UWP has no trigger any more,but with other function instead,like this question: Trigger element (XAML) is not supported in a UWP project I did it with DataTriggerBehavior as the tutorial: <ControlTemplate TargetType="Button" x:Key="ButtonControlTemplate"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding

UWP: How to catch the click of a listview part from another listview in the viewmodel instead of code-behind?

江枫思渺然 提交于 2019-12-21 21:38:24
问题 I have this listview: <Page x:Class="DataBase.ControlsPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DataContext="{Binding CustomersViewModel, Source={StaticResource ViewModelLocator}}"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <ListView Name="HeaderList" ItemsSource="{Binding Customers}"> <ListView.ItemTemplate> <DataTemplate> <Grid> <Border Background="Bisque"> <TextBlock Text="

How can I bind inside this ControlTemplate?

淺唱寂寞╮ 提交于 2019-12-21 21:36:16
问题 I have a ListView , filled with a List<MyListItem> and I need to use a ControlTemplate to be able to change the effects when an item is selected. Now I have the problem that {Binding MyProperty} doesn't work inside of that ControlTemplate . How can I access the properties of MyListItem inside the template? My XAML looks like this(simplified): <ListView Name="ListView" Grid.Column="1" IsSwipeEnabled="False"> <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <Setter Property=

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

寵の児 提交于 2019-12-21 20:48:10
问题 How is the compiled binding, x:Bind, different from the classical Binding, put as concisely as possible? 回答1: 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