windows runtime - How to pass an instance of an ancestor control in XAML? -


i'm looking pass property outerdialog user control, innerdialog follow:

<uc:outerdialog x:name="test" grid.columnspan="2" grid.rowspan="2" height="768" width="1366" isopen="false">     <uc:standarddialog height="768" width="1366" grid.columnspan="2">         <uc:innerdialog ancestordelegate="anotherdialog.close">          </uc:innerdialog >     </uc:standarddialog> </uc:outerdialog > 

can without resorting code behind?

how can reference "closest" ancestor object , pass on?

the best way approach have shared datacontext pointing view model has property both controls synchronize with. other can use {binding close, elementname="anotherdialog"} bind close property on element called anotherdialog, assuming both in same namescope..


Comments