I’m trying to convert my application to use the MVVM pattern. I currently have a custom canvas object that inherits form the standard canvas object, and overrides the OnRender event.
I am not quite sure how to convert this method to use the MVVM pattern.
Currently, I have an event wired up to different keypresses, to control the canvas and allows the user to scroll. I have gotten the event stuff wired up in MVVM using MvvmLight. I am just unsure about how when the Command fires in the view, that it updates the canvas. Currently there is a method that is called, that tells the control which direction the user has moved. (I basically pass in a location which is the index of an array).
Just not sure what I should be doing here.
I ended up going with DependencyProperties and using the DependencyProperties OnPropertyChanged Event Callback to update the graphics.