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

Unable to generate auto generated files in relay compiler for mutations

I am trying to create a web application with ReactJs as frontend, GraphQL as service layer and Relay as communication between service layer and frontend. In this i created a mutation in service layer and integrated in front end.At last tried to…
0
votes
1 answer

Binding RelayCommand don't want to execute

I have got Page.xaml
4est
  • 3,010
  • 6
  • 41
  • 63
0
votes
1 answer

Binding a command to listboxitems

Is it possible to bind a relaycommand to listboxitems when on of the items is clicked?
Olsen
  • 155
  • 1
  • 2
  • 5
0
votes
1 answer

Correct way to handle commands that rely on multiple view models

I'm relatively new to WPF and MVVM and i am trying to understand how to use commands correctly when they have dependencies in more than 1 view model. A couple of examples: In my current application i have a RelayCommand which causes a save action…
DaeDaLuS_015
  • 110
  • 5
0
votes
2 answers

Galasoft RelayCommand not firing

I am using the MVVM Light framework to build a SL4 application. My simple app is composed primarily by a single main view (shellView), which is divided into multiple UserControls. They are just a convenient separation of the UI, therefore they don't…
Anthares
  • 1,041
  • 1
  • 13
  • 30
0
votes
1 answer

Why do I need getters and setters in ICommand?

New to C#/MVVM and this doesn't make sense to me? This is my implementation of a RelayCommand inheriting from ICommand: internal class RelayCommand : ICommand { private readonly Predicate _canExecute; private readonly Action…
Harsh Baid
  • 59
  • 8
0
votes
0 answers

Access the main window control from a usercontrol control's relay command

I have MainWindow.xaml with a usercontrol (ButtonClusterUserControl.xaml) and a TextBlock control. The usercontrol itself has 2 buttons: Hide and Show. Requirement is something like when the Hide button is clicked, it should hide the…
Rajasri.J
  • 148
  • 2
  • 17
0
votes
0 answers

MVVM Light RelayCommand no works longer after Visual Studio update

I'm developing a WPF application with MVVM Light 5.4.1. The .NET Framework is 4.6.2. I use RelayCommand : public class TestViewModel : ViewModelBase { public ICommand TestCommand { get; set; } private string _test = "test"; public…
Speed Neo
  • 57
  • 6
0
votes
1 answer

c# Datagrid / Binding a button with Parameter using Josh Smith's RelayCommand class?

I've been using Rachel's solution to bind a button with a Command : https://stackoverflow.com/a/3531935/4713963 Now I would like to do the same within a DataGrid. Sample code :
Coloris
  • 35
  • 8
0
votes
1 answer

Adding CommandParameter when associating MVVM-Light RelayCommand to button breaks CanExecute

I am not sure if this is an MVVM-Light bug or just something that doesn't work in WPF.... I have a button where I am setting the Command property to a RelayCommand. Everything works fine as long as I don't set the CommandParameter property. Once I…
MCE
  • 3
  • 2
0
votes
1 answer

MVVM, Button in a ItemsControl, ICommand

Having trouble trying to implement a Command on a button using ICommand/RelayCommand where when you press a button in a list, it removes the item. I have looked up ICommand/Relay Command, have had numerous attempts at implementing it, but with no…
Crankys
  • 13
  • 1
0
votes
1 answer

Xamrin Button is not working for mmvm-light Relay Command

In my Xamrin forms code i have configured MVVM light RelayCommand is not hitting even though I have set the property in xaml page for the command. XAML
shamnad
  • 328
  • 5
  • 21
0
votes
2 answers

Bind RelayCommand to Button Click or CodeBehind

i want bind RelayCommand to Button Click event (i know i can bind to command property but i want bind to click event) how i can do this? i used this code but not work: private void Button_Clicked(object sender, RoutedEventArgs e) {…
user7512258
0
votes
1 answer

How can I unit test RelayCommand DropFile?

I'm trying out MVVM Light, partly inspired by the EventToCommand capabilities which seem to make it easier to handle drag-and-drop from outside my app in the View Model and in the XAML. However I am a confused by how to unit test the RelayCommand.…
dumbledad
  • 16,305
  • 23
  • 120
  • 273
0
votes
1 answer

MVVM property with a linked complex class and CanExecute Relay Command not working

I have a entity class in a C# library class and linked to Silverlight class library (entities must be in C# class because of legacy compatiblity with other systems) Example (C# library): public class TestClass { private string…
KolarJ
  • 21
  • 3