-
For example, if I define a dialogHost in viewA, can I also open this dialogHost in viewB without having to redefine the same dialogHost in viewB?I tried defining the style of the dialog in DialogHost.DataTemplates or Resources, but it seems that neither approach allows the dialog to be used by other views. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hello, @nir34 You should use different DialogHosts. But yes, you can use the same dialog content in multiple views as long as it isn't a control itself (viewmodel for example). Controls as dialog content can't be used in multiple views simultaneously, since control can't have more than one parent. |
Beta Was this translation helpful? Give feedback.
This can solve the problem:
var template = Application.Current.FindResource("xxx");
diaogHost.DataTemplates.Add(template as IDataTemplate);