Questions tagged [commandparameter]

127 questions
3
votes
2 answers

How do I pass entry parameters to Xamarin MVVM viewmodel

I was looking for the best way to pass entry parameters (username, password) to Xamarin MVVM viewmodel by clicking a button(in the view) with command parameters.
Sadjad Khazaie
  • 2,102
  • 22
  • 22
3
votes
1 answer

IMultiValueConverter values are okay, but CommandParameter is null

I am trying to pass several values through an IMultiValueConverter to a command (as the command parameter). The values are correct when they go through the converter, but once the Can_Execute() and Execute() comands get called, I get an array of…
Amanduh
  • 1,233
  • 1
  • 13
  • 23
3
votes
1 answer

MVVM Light canExecute always false with RelayCommand not RelayCommand
Do anyone know why being specific with the MVVM Light RelayCommand generic type would cause its canExecute to always resolve to false for the binding? In order to get the correct behavior I had to use an object and then convert it to the desired…
Rock
  • 182
  • 11
3
votes
1 answer

WPF: Menu Items only bind command parameters once

Ive noticed this a couple of times when using menus with commands, they are not very dynamic, check this out. I am creating a menu from a collection of colours, I use it to colour a column in a datagrid. Anyway when i first bring up the menu (its a…
Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
3
votes
1 answer

How to pass index of an ItemsSource as CommandParameter in WPF

In WPF: How can i pass the index of a ItemsSource loop as a CommandParameter?
3
votes
1 answer

CommandParameter is Nothing from ListView command binding

I am not succeeding in sending CommandParameter from ListView item. My code is below.
Nuts
  • 2,755
  • 6
  • 33
  • 78
3
votes
1 answer

WPF treeview contextmenu command parameter

I have TreeView with HierarchicalDataTemplate. On TreeView I have ContextMenu
monstr
  • 1,680
  • 1
  • 25
  • 44
3
votes
1 answer

WPF Set Binding on CommandParameter dynamically in code

I need to dynamically create some TreeViewItems, each of them needs to have a Command bind to DoubleClick Mouse Action. The problem is that i want to pass a parameter to this Command, but I don't know how to do it. Currently code: private void…
Jamby
  • 1,886
  • 2
  • 20
  • 30
3
votes
1 answer

Binding to Control which applied the Style/Template

I want to (re-)template a Control, for example a ComboBox. XAML: In the ControlTemplate I want to have a Button. ResourceDictionary:
David
  • 4,027
  • 10
  • 50
  • 102
2
votes
1 answer

Pass a CommandParameter using MVVMLight EventToCommand and the Page Load event?

EventToCommand fails to pass Command Parameter on Load Event When attached to the Load event of the page or user control the EventToCommand successfully calls the handler in the ViewModel but does not pass the CommandParameter. However, the same…
2
votes
0 answers

Binding an enum to MVVM Light RelayCommand CommandParameter

I'm trying to bind the command parameter in XAML for a RelayCommand as below, where MessageTokens is an enum public ICommand OpenInvoiceWindowCommand { get { return…
Jeremy Holt
  • 325
  • 6
  • 16
2
votes
1 answer

WPF selectedItem on Menu or get commandparameter in viewmodel

I am searching for hours to fix a simple problem. I wanted to work with "SelectedItem" on my menuItems, but after hours of stackoverflow I saw that's impossible. I found a lot about "CommandParameter" but I don't understand how it works. This is…
2
votes
1 answer

CommandParameter is always NULL

I want to implement a simple Close Button in a WPF Window. The Window basically looks like this:
CeOnSql
  • 2,615
  • 1
  • 16
  • 38
2
votes
3 answers

How to have an enum value in CommandParam in XAML

I have the following enum that represent a state of UI (I use it to enable and disable UI elements): enum Mode { EDIT, RUN, REVIEW } I would like to pass Mode.EDIT to command in CommandParam:
2
votes
1 answer

New window as CommandParameter every time

I want a button to show app settings window like this:
1
2
3
8 9