Questions tagged [delegatecommand]

WPF design pattern that provides a generic reusable implementation of ICommand. Versions of this object can be found in the versions of Microsoft Prism.

95 questions
0
votes
1 answer

Implementing RaiseCanExecuteChanged method inside setter of a class object

I am still not sure if my approach is correct, but in an attempt to implement the MVVM pattern, I have created a model class 'Test' in the following way: public class Test : BindableBase { private int testNumber; public int TestNumber { …
r_laezza
  • 109
  • 1
  • 2
  • 13
0
votes
3 answers

WPF How to execute command for current active tabitem?

I'm using prism TabControl Region inside the shell view. Each TabItem contains AView and AViewModel. I can determine the currently active TabItem using a property IsActive property in AViewModel. IsActive property is set to true only for the current…
IBRA
  • 1,035
  • 3
  • 20
  • 50
0
votes
2 answers

Can execute question using delegate commands in prism

This seems like a dumb question but I have looked through the docs for prism and searched the internet and can't find an example... Here is the deal. I am using a DelegateCommand in Prism, it is working fine except when I assign a delegate to the…
Kenn
  • 2,571
  • 2
  • 26
  • 57
0
votes
1 answer

Prism DelgateComand throws an exception

I have a static delegate command. I'm passing a bool to the constructor. However, it is throwing a runtime exception. public static class myViewModel { public static ICommand myCommand {get; private set;} static myViewModel { …
John
  • 87
  • 10
0
votes
1 answer

In WPF/Prism, what happens with a CompositeCommand when a DelegateCommand.RaiseCanExecuteChanged is fired?

Say that I have a CompositeCommand with a lot of DelegateCommands registered. If one of the child DelegateCommands fires up RaiseCanExecuteChanged, this will result in firing the event CompositeCommand.CanExecuteChanged, raising this same event in…
Carlos Melo
  • 2,703
  • 3
  • 33
  • 44
0
votes
1 answer

Exception Handling in Prism Async DelegateCommand

I am having a lot of troubles to catch an exception in a async DelegateCommand (Prism 5). In constructor of the ViewModel: cmdModificarPedido = New DelegateCommand(Of Object)(AddressOf OnModificarPedido, AddressOf CanModificarPedido) In the…
Carlos
  • 822
  • 1
  • 13
  • 27
0
votes
1 answer

Why is this command not invoked?

Here is what I consider the relevant part of the ListView in question:
ProfK
  • 44,292
  • 106
  • 358
  • 713
0
votes
0 answers

How can I notify the containing Window that a certain UserControl it contains invoked an ICommand/RelayCommand/DelegateCommand?

TL/DR: How can I notify the containing Window that a certain UserControl it contains invoked an ICommand/RelayCommand/DelegateCommand ? I want to respond the CanExecuteChanged events in the Window. Expansion: The UserControl:
Tar
  • 7,277
  • 7
  • 45
  • 101
0
votes
1 answer

DelegateCommand with another CanSee func except CanExecute

I want to create context menu item collection that each one of the item have header, command, can execute command and also to add a new feature for visibility that is also function like 'canExecute' but with other condition. When i'm pressing on a…
user436862
  • 779
  • 1
  • 13
  • 29
0
votes
1 answer

Populate a second DataGrid once I double click on a row WPF

I am still a little new to wpf and MVVM. I am trying to code a solution without breaking that pattern. I have two (well three, but for the scope of this question just two) DataGrids. I want to double click on the row of one, and from that load…
SoftwareSavant
  • 8,456
  • 26
  • 107
  • 186
0
votes
2 answers

WPF DelegateCommand RaiseCanExecute

I am trying to use custom delegate command But, an automatic RaiseCanExecuteChanged does not work properly. Is it nice to use CommandManagerHelper (every time when application in focus, it raise canexecute changed for every command? Or I have to…
Alex
  • 702
  • 10
  • 26
0
votes
1 answer

WPF Prism MVVM - Same "Partial View with Command" in one page, how to subscribe the Command?

My project using MVVM design pattern using Prism and Unity, basically following the famous Prism video by Brian Lagunas, but the video didn't mention how to create/use partial view, User Control used in other User Controls. I'm trying to create…
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
  • 11,796
  • 21
  • 88
  • 170
0
votes
1 answer

Overloaded method for DelegateCommand

I have a DelegateCommand class and within it 2 constructors. When I pass my property to the constructor of that class I get an error message that says: Error 1 The best overloaded method match for…
pallasmedia
  • 1,339
  • 4
  • 24
  • 54
0
votes
1 answer

Why isn't my command parameter binding correctly?

I'm trying to bind a button command to take the text of a textbox as a parameter when the button is clicked. My Xaml looks like this:
Raumornie
  • 1,444
  • 9
  • 14