Thanks chaps, sorry for the late reply. It turns out I didn't need to "pass"
the command on from the dialog to the main window for this particular case,
but I'm sure I will at some time in the near future and this issue will
return and I'll have to find an elegant way of doing it.

 

Context menus are general problem in WPF due to their quirks in binding and
commands. I haven't looked into it, but they don't live in the control tree
in the usual way. Same with DataGrid columns and some other bits and pieces.

 

Carl, I ran some experiments and removed PlacementTaget from dozens of my
menus and they all continued to work, except some attached to a ToolBarTray
which required this element:

 

CommandTarget="{Binding Path=PlacementTarget, RelativeSource={RelativeSource
FindAncestor, AncestorType={x:Type ContextMenu}}}"

 

So for years now I have assumed that I needed that line on my menus,
probably due to early problems like the one with ToolbarTray, but it turns
out most of them aren't needed. I have globally removed the unnecessary
elements and it's nice to remove XAML clutter. So thanks for the reminder to
look into that issue.

 

Patrick, what tools/kits are you using to write HTML/JS?

 

Greg 

 

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to