Questions tagged [relaycommand]

RelayCommand is an implementation of the .NET ICommand interface made and described by WPF expert Josh Smith.

289 questions
0
votes
1 answer

How to display validation error in button bound to command

I am developing an app and trying to stick to an MVVM model, I have a button that is just bound to a command. Currently the command can be enabled / disabled and greys out the button when the command is set to CanExecute false. But I want to add the…
BrandonAGr
  • 5,827
  • 5
  • 47
  • 72
0
votes
2 answers

RelayCommand Won't Execute On Button Click

I've been stuck on this problem for a few hours. I am attempting to implement an MVVM-style Word Add-In in WPF. I am not using an MVVM toolkit. I have a WPF user control that is docked within a WinForm. While I am able to see the WPF user control…
RudyD
  • 87
  • 1
  • 10
0
votes
1 answer

Windows Phone does not set SelectedItem when ItemTemplate has ScrollViewer

I'm using the ReorderListBox control that allows for items to be drag/dropped around in a listbox. I'm also using MvvmLight, an EventTrigger and the EventToCommand class to capture the Tap event and execute a RelayCommand handler. Everything works…
sohum
  • 3,207
  • 2
  • 39
  • 63
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

Open Child Window Standard

Disclaimer: I'm still learning MVVM and WPF so this might just be a ICommand vs RelayCommand question for all I know. I'm not using a MVVM framework or the like, just VS2010. Currently I have a MainWindow with a Login button that opens a child…
PRX
  • 137
  • 10
0
votes
0 answers

Creating RelayCommand without implementing ICommand

My query is how can I create a class behaving same as RelayCommand but without implementing ICommand for my MVVM application? Any suggestions are much appreciated. My RelayCommand [which implements ICommand] is as below: public class…
WpfBee
  • 2,837
  • 6
  • 23
  • 29
0
votes
1 answer
0
votes
0 answers

How to make a custom control WPF Resource Dictionary with MVVMLight RelayCommands

Can i / How can I attach commands to a custom control i made and put it into a Resource Dictionary in WPF? I would like to not define this control in multiple places and also not have the code in code-behind file of the XAML for it. Here is the…
0
votes
1 answer

Int Property handling RelayCommand in MVVM

I have a Property which looks like this: private int _wertungvalue; public int WertungValue { get { return _wertungvalue; } set { _wertungvalue = value; RaisePropertyChanged(() => WertungValue); } } It's binded to a…
Rudi
  • 926
  • 2
  • 19
  • 38
0
votes
1 answer

How to pass my view model to a user to main view model?

I made a main window that displays various user controls in a content control. In this window, I have the user controls and their accompanying view models in the XAML as DataTemplate Resources. This window has a button that needs to display the…
0
votes
1 answer

When To Use ICommand Wrapped With RelayCommand and when to use Just ReplayCommand?

I am a bit confused about ICommand and RelayCommand If I do this on an autocomplete control public RelayCommand AutoCompleteCommand { get; private set; } public MyConstructor() { AutoCompleteCommand = new…
chobo2
  • 83,322
  • 195
  • 530
  • 832
0
votes
1 answer

wpf mvvm equality

I would like to use an MVVM in a WPF project I'm working on, including the use of RelayCommands (aka DelegateCommands). I'm running into an interesting but frustration problem in implementing equality for my ViewModels, outlined here. I have a base…
Berryl
  • 12,471
  • 22
  • 98
  • 182
0
votes
2 answers

RelayCommand.CanExecute not updating IsEnabled in UI

I have a Windows Phone 8 app and I have a RelayCommand Instance called DiscoverExpansionModulesCommand. I have a button with the Command property bound to DiscoverExpansionModulesCommand. When the app first loads, the button is enabled or disabled…
Keenan Newton
  • 53
  • 1
  • 6
0
votes
1 answer

Relay command using injected data service not invoked

When I use an injected instance of a data service in the lambda statement that defines a relay command handler, the handler is never invoked (it is associated with a button). When I declare an instance of the data service within the lambda, it works…