relaycommand Questions

3

Solved

I got the following code from Josh Smith's MVVM tutorial. Can anyone provide a quick explanation of what this code actually does? public event EventHandler CanExecuteChanged { add { CommandManag...
Cresida asked 9/7, 2011 at 12:37

13

Solved

So my first attempt did everything out of the code behind, and now I'm trying to refactor my code to use the MVVM pattern, following the guidance of the MVVM in the box information. I've created a ...
Charlie asked 14/8, 2012 at 4:31

5

Trying to use the RelayCommand class below I received the error message: "The name "CommandManager" does not exist in the current context". According to this post Class library does not recognize C...
Randellrandene asked 25/1, 2016 at 15:26

4

Solved

I have the following code defined in a viewmodel. I think that the SaveAsync of type Func<Task> is getting converted to Action since RelayCommand takes an Action not a Func<Task> but I'...
Cathar asked 2/8, 2014 at 20:52

3

Solved

I'm writing a WPF 4 app (with VS2010 RC) using MVVM Light V3 alpha 3 and am running into some weird behaviour here... I have a command that opens a Window, and that Window creates the ViewModel an...
Sikorsky asked 21/2, 2010 at 13:49

3

Here is my code from the View.xaml.cs: private RelayCommand _closeCommand; public ICommand CloseCommand { get { if (_closeCommand == null) { _closeCommand = new RelayCommand(param => this....
Persnickety asked 11/12, 2012 at 18:47

1

Solved

A very common implementation of RelayCommand seems to include the following lines: public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { C...
Jumbo asked 10/3, 2016 at 8:4

2

Solved

I have a WPF application in which i'd like to change its design pattern to MVVM.I have used this snippet using System; using System.Collections.Generic; using System.Linq; using System.Text; usi...
Buttress asked 28/1, 2014 at 12:39

4

Solved

I'm implementing an RelayCommand with an execute and an canExecute part. The RelayCommand works when it is without the canExecute part, however when I add the canExecute part, the command locks the...
Bondage asked 14/10, 2013 at 16:1

2

Solved

What are the performance implications of using the CanExecuteCommand of the ICommand object. Is the method executed over and over again? I need to iterate through a collection of about 200 object...
Pulse asked 7/9, 2011 at 14:33

2

Solved

I am facing some problems using GalaSoft's RelayCommand. I have a NextCommand property that works, but only several times. Afterwards, it stops working completely. You can try this out with the...
Acidosis asked 16/9, 2014 at 11:59

5

Solved

I have already read Josh Smiths article about binding commands to view model using RelayCommand. However I need to bind ApplicationCommands.Save to a view model so that when a user clicks the save ...
Resort asked 18/5, 2011 at 17:17

2

Solved

I've been programming a lot in WPF lately but my View and ViewModel are not separate at this point. Well, it's partially. All my bindings concerned to text in text boxes, content for labels, lists ...
Taunyataupe asked 9/3, 2014 at 18:0

1

Solved

I am creating an application using .Net and MVVM Light and I am having some trouble for RelayCommands. I'm trying to create a RelayCommand which takes in a single argument and passes it to a funct...
Bistro asked 19/10, 2013 at 16:5

2

Solved

I am using MVVM-Light and i have my relay command working perfectly, I have just read that i should be implementing CanExecuteChanged and CanExecute. Although i am unable to find a good example. D...
Haematothermal asked 3/5, 2011 at 13:33

2

Solved

I'm new at C#, WPF and MVVM pattern. Sorry for this quite long post, I am trying to set all my points of understanding (or non understanding). After studying a lot of texts on the commanding mecha...
Salinasalinas asked 2/5, 2013 at 15:34

3

Solved

How do you get event sender when using RelayCommand?
Thoraco asked 3/6, 2010 at 6:51

3

Solved

I'm having an issue with passing a parameter to a relaycommand using the GalaSoft MVVM Light framework. I know that mvvm light's implementation of relaycommand doesn't use lambda parameters, so I d...
Tamarra asked 14/3, 2011 at 13:2

1

Solved

I'm using the current version of MvvmLight available on Nuget (4.1.23.0) and calling RaiseCanExecuteChanged does not appear to be doing anything in a unit test. The scenario is very simple, I have ...
Alegar asked 20/8, 2012 at 7:34

2

Solved

How can I use the RelayCommand in wpf?
Scouring asked 14/5, 2009 at 10:16

4

What is the Difference between the RoutedCommand and RelayCommand ? When to use RoutedCommand and when to use RelayCommand in MVVM pattern ?
Modify asked 16/3, 2009 at 11:20

1

Solved

I have the following code: <DataGridTemplateColumn Header="Security"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button Name="Security" Conten...
Unsophisticated asked 25/5, 2012 at 18:20

6

Solved

If you're doing MVVM and using commands, you'll often see ICommand properties on the ViewModel that are backed by private RelayCommand or DelegateCommand fields, like this example from the original...
Festal asked 24/6, 2010 at 17:3

5

Solved

Consider the reference Josh Smith' article WPF Apps With The Model-View-ViewModel Design Pattern, specifically the example implementation of a RelayCommand (In Figure 3). (No need to read through t...
Kellogg asked 17/2, 2010 at 14:46

2

Solved

I'm just learning about MVVM in WPF, I'm completely new both to WPF as to MVVM (I understand how it works, but have never used it...) Every single tutorial/article I find on the web, it uses eithe...
Emmott asked 13/9, 2011 at 13:43

© 2022 - 2024 — McMap. All rights reserved.