c# - MahApps Metro DialogCoordinator: Display Dialog to span UserControl only (instead of entire window)? -
i'm epxloring different ways best show dialog windows in application. mahapp metro's idialogcoordinator seems quite useful, couldn't quite adjust use case yet.
say i'm creating usercontrol (view), viewmodel needs able display dialogues. these dialogues should, when displayed, overlay/span usercontrol only, not entire window in usercontrol hosted.
is there way achieve this?
default behavior seems span on entire window, , haven't found way change yet.
so far, i've been using dialog coordinator in straightforward way, doing following in view:
<usercontrol xmlns:dialog="clr-namespace:mahapps.metro.controls.dialogs;assembly=mahapps.metro" dialog:dialogparticipation.register="{binding}">
and set set instance in view's constructor by,
viewmodel.initialize(dialogcoordinator.instance);
which i'd call in viewmodel via
idialogcoordinator _dialogcoordinator; // set viewmodel.initialize() called view private async task _somecmdexecute() { await _dialogcoordinator.showmessageasync(this, "header", "test"); }
thanks!
dialogs in mahapps.metro always @ window level (see container part_metroactivedialogcontainer
in window's style.)
what can changing styling of dialogs, don't stretch horizontally accross entire window. see default template metrodialogtemplate
reference.
wiki
Comments
Post a Comment