Hi ,
I need to pass object from xaml(view ) to view model using binding
eg
I need to pass this RadGridInstance to viewmodel using binding any idea
I need to call some methods like
radObject.ScrollIntoView(radObject.SelectedItem); in viewmodel
i dont want to write code on codebehind file
Thanks in Advance .
Baimey RajeshPosted Mar 29, 2011, 5:54 AM
Please be clear about the concept.
View have the object of the viewmodel so obviously u can get the object of that particular grid object by getting the item source.
To send the selected Item to the view model u can use commands.
or u can expose a property in view model and update it from the view object event handler
Normally, we use data binding and command to connect a View to a ViewModel. With data binding, the changes on the controls in the View will be reflected to the ViewModel automatically. To react to the user's operations on the View, e.g. clicks on a Button, you can invoke a command from the View and handle the command in the ViewModel.
U can see this
or
U can see this so that it gives u a code snippet for the same.
Please do mark if it helps....
Thanks
Paru
rajesh p vPosted Mar 29, 2011, 5:48 AM
Hi Gopi,
Why do u have to call a view from ur view model??
there are commands that help for the same
Thanks
Rajesh