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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -