Questions tagged [commandparameter]
127 questions
0
votes
2 answers
WPF Command: parameter from user control
I'm in my MainWindowView.xaml. It includes a usercontrol.
I'm trying to set a command with a parameter. This parameter is the selected row of a gridControl (devexpress item).
I have tried two binding, both wrong (they don't find the…

Piero Alberto
- 3,823
- 6
- 56
- 108
0
votes
1 answer
WPF CommandParameter is not recognized in code
This is a WPF application. button is null and CommandParameter is not recognized. I'm not sure how to fix this. Any ideas?
this is the code:
private void Button_Click(object sender, RoutedEventArgs e)
var button = (Button) sender;
var userName =…

NNassar
- 485
- 5
- 11
- 25
0
votes
2 answers
WPF XAML - How to submit a parameter to a template?
I have a ContentControl with a Grid in it. There is a Template for ContextMenu of each ListBoxItem. The ContextMenu Looks like this:

Michi-2142
- 1,170
- 3
- 18
- 39
0
votes
1 answer
Sending data type as command parameter
I have a list view, which items are defined using ItemsSource.
The ItemsSource is a list of local class type.
I need to send as a CommandParameter the selected items DataType.
Can someone help me with this?
Code: (This code is in the App.xaml and…

g-los
- 33
- 1
- 7
0
votes
2 answers
Get TabItem Name in UserControl
I have the following code that creates a TabControl. Each tab contains a UserControl (code is below) that displays different data (one shows Local tax info and the other show Fed/State tax info).
TabControl

BrianKE
- 4,035
- 13
- 65
- 115
0
votes
1 answer
Pass different commandparameters to same command using RelayCommand WPF
So, what I am trying to achieve here is to use the same command to execute some different kind of code. The way I want to distinguish between the code I want to be executed can be done using commandparameters. I just don't see how I can do it the…

Jesper Plantener
- 229
- 3
- 16
0
votes
1 answer
How to add the RoutedEventArgs as the Command Parameter
We can use ICommand instead of Routed Event to implement MVVM,
so we can write the logic in ViewModel.
Here is a example:
But we need to Set CommandParameter all by ourself,
and my…

johnson
- 388
- 5
- 16
0
votes
1 answer
Convert powershell cmdlet to C#
How could I convert the follow powershell command to C# code, especially parameters for -index.
Get-Mailbox | select-object -index 0, 1, 2, 3, 4, 5
I just want to retrieve the mail box many times to avoid extremely big memory usage.
How to set 0, 1,…

ryo
- 59
- 7
0
votes
1 answer
Issue with Windows Store app CommandParameter; doesn't bind to UIElements or their properties?
The past couple of hours I've been trying to pass a GridView's SelectedItem to a CommandParameter with all sort of crazy ways from different binding styles to crazy-hacky converters.
Each time the command is executed the parameter appears null. Also…

Tinya
- 1
0
votes
1 answer
Retriving cell value from gridview rowcommand
hey I'm using to buttons in a gridview each which I want to assign to specific action involves retrieving certain cell values from the gridview columns
I tried using
GridViewRow row = (GridViewRow (((Button)e.CommandSource).NamingContainer);
but…

Scarnet
- 738
- 2
- 11
- 36
0
votes
1 answer
WPF Get Current selection in FlowDocumentScrollViewer into CommandParameter
Trying to get selected text in a flow viewer to a command as a parameter
0
votes
1 answer
In WPF, How to get a Command Parameter from a specific item in a Collection View Source that is bound to a ListView?
My Goal: Right click on a specific item in my ListView, a context menu pops up, select a command, followed by me running a function based on which item's context menu was selected.
My ListView's ItemsSource is bounded to a CollectionViewSource,…

Kevin Quiring
- 639
- 1
- 11
- 26
0
votes
1 answer
Eclipse RCP 3.7 menu disappears after command paramter configured
I have a command to launch views configured in plugin.xml of an RCP application module as follows:

Klaus Nji
- 18,107
- 29
- 105
- 185
0
votes
1 answer
Source of ElementName cannot be found in separate view
My WPF application in C# makes use of the MVVM pattern. There are two user controls I have defined:
LoginView
ProjectsView
Both user controls are added to a main window and make use of the same view model. The LoginView contains a PasswordBox…

Robert Strauch
- 12,055
- 24
- 120
- 192
0
votes
2 answers
Command and CommandParameter design
Let's say you have a view-model that controls a media player. It has to offer standard control features like Star, Stop, Pause and Resume.
I'm thinking of two ways to design it in the view-model
1st Way : Every action has its own command.
-…

Mohamed
- 121
- 1
- 7