Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改Prism Dialogwindow的窗口样式_Prism - Fatal编程技术网

更改Prism Dialogwindow的窗口样式

更改Prism Dialogwindow的窗口样式,prism,Prism,如何通过触发器动态更改窗口样式? 比如: ` 您可以注册自己的IDialogWindow实现,它拥有您想要的所有样式 库实现的代码和作为参考。谢谢您的帮助:),但例如,在切换到新Prism之前,我们使用了PopupWindowAction来生成默认窗口或自定义窗口: var wrapperWindow = GetWindow(args.Context); wr

如何通过触发器动态更改窗口样式? 比如:


`

您可以注册自己的
IDialogWindow
实现,它拥有您想要的所有样式

库实现的代码和作为参考。

谢谢您的帮助:),但例如,在切换到新Prism之前,我们使用了PopupWindowAction来生成默认窗口或自定义窗口:

  var wrapperWindow = GetWindow(args.Context);                                                                
  wrapperWindow.ShowDialog(); 
GetWindow返回一个窗口或CustomWindowObject

这是自定义窗口样式:

   <Style x:Key="DialogStyleTheme" TargetType="implementation:CustomDialogWindow">
    <Setter Property="WindowStyle" Value="None" />
    <Setter Property="ResizeMode" Value="CanMinimize" />
    <Setter Property="SizeToContent" Value="WidthAndHeight" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="AllowsTransparency" Value="True" />
    <Setter Property="FontSize" Value="60" />
    <Setter Property="ShowInTaskbar" Value="False" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="implementation:CustomDialogWindow">
                <Border BorderThickness="2" CornerRadius="10" BorderBrush="White" Background="DimGray"
                        x:Name="MainBorder">
                    <Grid Background="{TemplateBinding Background}" Margin="5,5,5,5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="30" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0" x:Name="MoveGrid">
                            <Image x:Name="Image">
                                <Image.Style>
                                    <Style TargetType="Image">
                                        <Setter Property="Stretch" Value="UniformToFill" />
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding SmallTitle}" Value="true">
                                                <Setter Property="Height" Value="40" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Image.Style>
                            </Image>
                            <TextBlock Text="{Binding Title}">
                                <TextBlock.Style>
                                    <Style BasedOn="{StaticResource TouchHeadTextBlock}" TargetType="TextBlock">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding SmallTitle}" Value="true">
                                                <Setter Property="FontSize" Value="25" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </TextBlock.Style>
                            </TextBlock>
                        </Grid>
                        <ContentPresenter Grid.Row="2" x:Name="ContentPresenter" ClipToBounds="True" />
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
初始化:

    containerRegistry.RegisterDialog<ItemSelectionDialogView, ItemSelectionDialogViewModel>();
    containerRegistry.RegisterDialogWindow<CustomDialogWindow>();
containerRegistry.RegisterDialog();
containerRegistry.RegisterDialogWindow();

你好,我已经知道IDialogWindow了。但我想通过样式触发器在普通窗口和游标窗口之间切换。当然,为什么不呢?复制现有实现,添加所需的任何样式和触发器,并将其注册为
IDialogWindow
,以覆盖默认值。
 prism:Dialog.WindowStyle="{DynamicResource DialogStyleTheme}"
    containerRegistry.RegisterDialog<ItemSelectionDialogView, ItemSelectionDialogViewModel>();
    containerRegistry.RegisterDialogWindow<CustomDialogWindow>();