wpf - how to pass composite object to view model -


i'm using mvvm light wpf.

currently can pass string parameter viewmodel's command below:

<textbox height="23" textwrapping="wrap" text="textbox" name="textbox1"/> <button command="{binding showmessage}" content="click me"         commandparameter="{binding elementname=textbox1, path=text}" /> 

my question how pass composite type person command of viewmodel?

thanks

<textbox height="23" textwrapping="wrap" text="textbox" name="textbox1" tag="{binding person}"/> <button command="{binding showmessage}" content="click me" commandparameter="{binding elementname=textbox1, path=tag}" /> 

you can make use of tag property of textbox think there wrong mvvm implementation,it viewmodel holds data view. here sending view vm . mean person should automatically there in vm instead of sending view.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -