I don't know how to tell to Save Command that properties of View Model was changed.I know that i have to use Can Execute Changed or Command Manager. Perhaps I am misunderstanding this, but if you don't want to command to execute until a value changes in your entities, why not add an "Is Dirty" field to your entities?When this happens you may have to manually force this refresh to occur.You can force the refresh in the View Model with this function: You don’t need to know about LANDesk or know what an LDPing is to understand what is going on enough to see how to use this one function. Here is the code: /// This is the Ping method that launches an LDPing as a Background Worker process, using /// Ping Worker which is an object that inherits Background Worker and adds one property called /// Ping Succeeded. Event Args) 'This is the Raise Event block 'Command Manager. Invoke End If End Function Public Sub Execute(By Val parameter As Object) Implements System. However, if your command is completed asynchronously (think background worker or similar with an oncompleted event) the oncompleted handle needs to update the appropriate data that the command relies on, then call the Raise Can Execute Changed event on the command. New(execute, Nothing) End Sub Public Sub New(By Val execute As Action, By Val can Execute As Func(Of Boolean)) If execute Is Nothing Then Throw New Argument Null Exception("execute") End If _Execute = execute _Can Execute = can Execute End Sub #End Region #Region "ICommand" Public Custom Event Can Execute Changed As Event Handler Implements System. Requery Suggested, value End If End Remove Handler Raise Event(By Val sender As Object, By Val e As System. Can Execute If _Can Execute Is Nothing Then Return True Else Return _Can Execute. WPF will use any local change to requery commands states, so, for example, if you click a button, or click the form, or if the change of the command state occurs as a result of a button click for example, this change will show without manually needing to prod the command. I have now made changes to my code and can work much more better and good at MVVM path.I've been using Josh Smith's implementation of Relay Command in a couple of large projects for some years now.
I'm at a loss as to what's causing it - the view-model isn't doing anything that I haven't done dozens of times already. The first one is a "start" command:- ('Is Running' is a bog-standard property, implementing INotify Property Changed.Invalidate Requery Suggested and i tried to use their some times but i don't know how to do it properly and it didn't take an effect. Set it to true whenever you change any field (add logic to the setters for properties to do this) and have your save command check the isdirty, run validation and then submit if all conditions are met.If you want to get really fancy, look into using the IObservable interface. I don't know how you have set the "Data Context" of your view to your view model, but assuming that is all correct and no issue, adjust the textbox and command button to something like Notice the text binding is to the "Entity" object on your MVVM and then the ". The important thing here is the Update Source Trigger.This forces an update back to your data binding for every character change, so as soon as you remove the last character, or start typing the first character, the "Save" button will then be refreshed respectively. There's a slight delay in the UI, but I'm not too worried about that.