xaml

UWP Databinding: How to set button command to parent DataContext inside DataTemplate

狂风中的少年 提交于 2020-11-28 07:08:11
问题 Short explanation of need: I need to fire the command of a button inside a DataTemplate, using a method from the DataContext of the ViewModel. Short explanation of problem: The templated button command only seems to be bindable to the datacontext of the item itself. The syntax used by WPF and Windows 8.1 apps to walk up the visual tree doesn't seem to work, including ElementName and Ancestor binding. I would very much prefer not to have my button command located inside the MODEL. Side Note:

UWP Databinding: How to set button command to parent DataContext inside DataTemplate

℡╲_俬逩灬. 提交于 2020-11-28 07:07:19
问题 Short explanation of need: I need to fire the command of a button inside a DataTemplate, using a method from the DataContext of the ViewModel. Short explanation of problem: The templated button command only seems to be bindable to the datacontext of the item itself. The syntax used by WPF and Windows 8.1 apps to walk up the visual tree doesn't seem to work, including ElementName and Ancestor binding. I would very much prefer not to have my button command located inside the MODEL. Side Note:

UWP Databinding: How to set button command to parent DataContext inside DataTemplate

99封情书 提交于 2020-11-28 07:07:12
问题 Short explanation of need: I need to fire the command of a button inside a DataTemplate, using a method from the DataContext of the ViewModel. Short explanation of problem: The templated button command only seems to be bindable to the datacontext of the item itself. The syntax used by WPF and Windows 8.1 apps to walk up the visual tree doesn't seem to work, including ElementName and Ancestor binding. I would very much prefer not to have my button command located inside the MODEL. Side Note:

UWP Databinding: How to set button command to parent DataContext inside DataTemplate

纵然是瞬间 提交于 2020-11-28 07:06:48
问题 Short explanation of need: I need to fire the command of a button inside a DataTemplate, using a method from the DataContext of the ViewModel. Short explanation of problem: The templated button command only seems to be bindable to the datacontext of the item itself. The syntax used by WPF and Windows 8.1 apps to walk up the visual tree doesn't seem to work, including ElementName and Ancestor binding. I would very much prefer not to have my button command located inside the MODEL. Side Note:

Filtering ICollectionView binded to ItemsControl

不打扰是莪最后的温柔 提交于 2020-11-25 03:56:50
问题 I want to make an WPF app for browsing recipes for dishes. Having trouble with filtering data. I'm using ItemsControl to make my data look like "tiles" in the window. Now i want to filter it with TextBox, but I cant figure what is wrong. Here is my XAML binding: <ItemsControl ItemsSource="{Binding}" Height="573"> Textbox: <TextBox x:Name="Szukaj" Text="{Binding Szukane, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="27.667" Margin="18.667,145,0,0" IsEnabled="True"