c# - Accessing the properties from a known view his viewmodel -
i have view contains usercontrol it's own view & viewmodel. the usercontrol it's views looks this: <usercontrol.datacontext> <viewmodel:timepickerviewmodel x:name="timepickerviewmodel"/> </usercontrol.datacontext> in viewmodel of usercontrol have property validtime: public datetime? validtime { { return validtime; } set { validtime = value; onpropertychanged("validtime"); } } in view contains usercontrol need acces property validtime: <timepicker:timepickerview grid.row="0" x:name="timepicker"/> <button grid.row="1" content="plan" command="{binding plancommand}" commandparameter=" {binding elementname=timepicker, path=validtime}"/> in viewmodel of last view have this: public icommand plancommand { { return plancommand ?? new relaycommand<datetime?>(plan); } } void plan(datetime? date) { if(pic...