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
Post a Comment