I have a user control that is displayed in a popup dialog using Prism's PopupWindowAction
. I don't want the window to be resizeable. Is it possible to style this window from the user control? I attempted to use this:
<UserControl.Resources>
<Style x:Key="WindowStyle" TargetType="{x:Type Window}">
<Setter Property="ResizeMode" Value="NoResize" />
</Style>
</UserControl.Resources>
but it is not working.
Edit:
Based on the accepted answer, I moved the style over to the user control that is defining the IteractionRequestTrigger
and assigning the PopupWindowAction
's WindowStyle
.
New code in calling use control:
Add Resource
<UserControl.Resources>
<Style x:Key="WindowStyle" TargetType="Window">
<Setter Property="ResizeMode" Value="NoResize" />
<Setter Property="SizeToContent" Value="WidthAndHeight" />
</Style>
</UserControl.Resources>
Popup Window declaration
<prism:InteractionRequestTrigger SourceObject="{Binding InteractionRequest}">
<prism:PopupWindowAction WindowStyle="{StaticResource WindowStyle}">
<prism:PopupWindowAction.WindowContent>
<sharedV:InformationDialog />
</prism:PopupWindowAction.WindowContent>
</prism:PopupWindowAction>
</prism:InteractionRequestTrigger>