DialogHost.Show() with a specific style #3114
-
I want to open a dialog from a ViewModel (like the sample 3 in the demo application) with the Is it possible to call |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
@Xaalek I don't think that is currently possible. You statically define this with So I guess what you're requesting is to specify a "temporary" style to use for this particular call to I guess it would be possible to introduce a scheme to temporarily inject a style. This could either be in the There may be some challenges with "when to restore the original style". Is this something you as a caller need to do? Or should it happen when |
Beta Was this translation helpful? Give feedback.
@Xaalek I don't think that is currently possible. You statically define this with
Style="{StaticResource ...}"
directly on theDialogHost
element.So I guess what you're requesting is to specify a "temporary" style to use for this particular call to
DialogHost.Show()
?I guess it would be possible to introduce a scheme to temporarily inject a style. This could either be in the
DialogHost.Show()
overloads, or perhaps you need a utility method which will find the relevantDialogHost
and apply a given style on it (which you could call from your ViewModel - although that smells a little; but so does callingDialogHost.Show()
from your VM one could argue).There may be some challenges with "whe…