c# - Pass parameter to UserControl in XAML -
i'm using syncfusion's dockingmanager
adapter mvvm list of viewmodels implement idockelement
can bound.
i'm using way:
<dm:dockingadapter grid.row="1" itemssource="{binding dockingitems}" />
in addition i'm using latest version of catel , custom controls.
the mvvm adapter of dockingmanager
needs these entries, create view viewmodel:
<datatemplate datatype="{x:type local:eventeditorviewmodel}"> <grid> <events:eventeditorcontrol/> </grid> </datatemplate>
the problem is, eventeditorcontrol
has parameter in constructor needs viewmodel.
how pass correct viewmodel?
you cannot pass parameters constructors using xaml.
make parameter dependency property:
<events:eventeditorcontrol myparameterasdependencyproperty="{binding someproperty}" />
Comments
Post a Comment