Questions tagged [commandparameter]

127 questions
1
vote
1 answer

WPF CommandParameter RelativeSource Binding

I have a ListView with a CheckBox inside of the ListView's DataTemple. I was shown how to make the Command work. I would like to capture the ListView SelectedItem to pass as a parameter to the Command, but I don't have it right...
mjordan
  • 319
  • 2
  • 22
1
vote
2 answers

How to get text from Xamarin SearchBar into viewmodel

Trying to get the text from a Xamarin Forms SearchBar into my viewmodel, and missing something, not sure what. Having read a lot of posts, I'm almost there, as intellisense generated the method for me automatically with obj as the parameter already…
donaldp
  • 220
  • 1
  • 3
  • 15
1
vote
2 answers

How can I pass the currently focused element name through a CommandParameter in XAML?

In my WPF MVVM application I want to be able to undo changes to individual TextBox elements using the Esc key. I've set up a command for this and I want to trigger it through XAML thus:
ifinlay
  • 621
  • 1
  • 7
  • 24
1
vote
0 answers

Syntaxproblem passing to MultiBinding in wpf

I try to pass from simple binding to MultiBinding for CommandParameter but can not find out the syntax for "{Binding}" in the following example for the multibinding example below. Thanks a lot for any hint ! Regards, Fabianus
Fabianus
  • 633
  • 7
  • 16
1
vote
1 answer

Binding to a command in code while passing command parameters

I recently implemented a solution into my code that allows me to bind to my command in my view model. Here is a link to the method that I used: https://code.msdn.microsoft.com/Event-to-Command-24d903c8. I used the 2nd method in the link. You can…
Chris
  • 363
  • 1
  • 4
  • 16
1
vote
1 answer

Passing a Different button in Command Parameter Wpf

Suppose, the followings are two buttons resides in a wpf user control.
1
vote
1 answer

Web API using command parameters is not returning any data

The web API to query the oracle database which receives the array of strings as an input parameter. I am trying to use the command parameters to avoid the SqL injection, but the below code does not throw any error but does not give the…
user4912134
  • 1,003
  • 5
  • 18
  • 47
1
vote
1 answer

How to Pass CommandParameter of Outer Collection Property to a Inner Collection in WPF

Here I'm having Outer ObservableCollection of model MobileModel. The MobileModel has an inner Collection of model MobileModelInfo I need to Pass the Property of OS as a CommandParameter which is inside the Inner Collection. The C# Source Code…
B.Balamanigandan
  • 4,713
  • 11
  • 68
  • 130
1
vote
1 answer

WPF CommandParameter GridViewColumnHeader

my question is: Is it possible to use a GridViewColumnHeader as a CommandParameter? I have the following code and I want to use the clicked ColumnHeader as the CommandParameter:
Dennis Schröer
  • 2,392
  • 16
  • 46
1
vote
2 answers

Command Parameter Datagrid SelectedItems is null

So I found this answer Pass command parameter from the xaml which I think got me most of the way there. The problem I am having is when I select a row in the datagrid it triggers the command but the selected items is null. What I don't know, and…
chris
  • 132
  • 2
  • 11
1
vote
1 answer

How to call a method from another class using WPF commands for buttons?

I am new to WPF and I've been searching all over the internet and have not found a solution to my problem. My question is, how do you call a method not in the code behind but from another class using Commands? Am I correct that Commands are the only…
user3854148
  • 49
  • 3
  • 9
1
vote
1 answer

pass contextmenu parent as CommandParameter

i have a HierarchicalDataTemplate for a TreeViewItem, in the template i have a contextmenu and i want to pass as CommandParameter the ContextMenu parent - i.e the TreeViewItem owner that was right clicked at the moment, is there a way to do that?…
user1531186
  • 323
  • 1
  • 7
  • 20
1
vote
1 answer

Need additional help with binding multiple CommandParameters using MultiBinding

I need to have a command handler for a ToggleButton that can take multiple parameters, namely the IsChecked property of said ToggleButton, along with a constant value, which could be a string, byte, int... doesn't matter. I found this great question…
Dave
  • 14,618
  • 13
  • 91
  • 145
1
vote
1 answer

WPF CommandParameter is NULL when binding to element

I am trying to bind the textbox text to Commandparameter. However in the call to CanExecute the parameter passed is null. Changing the text also does not call CanExecute. Is my use case valid ? View
Bhavesh
  • 293
  • 4
  • 10
1
vote
3 answers

Why is CommandParameter always null?

anybody an idea why CommandParameter is always null? The class TransactionViewModel has the collection property of TransactionCommands to be displayed in the ItemsControl. The items are of type CommandViewModel. TransactionBrowserViewModel has the…
Asesjix
  • 3,891
  • 3
  • 16
  • 19
1 2 3
8 9