1

別のウィンドウを作成し、XAML で設計します。メイン フォームから ShowDialog を呼び出すと、ダイアログ (ウィンドウ) が 1 回点滅してから表示されるように見えます。それは一般的な行動ですか?Windows フォームで作業している間、私はそれに気づきませんでした。別のコンピューターでもアプリケーションを実行しましたが、同じ結果が得られました。私は単純なゲームを開発していたので、気になります。ユーザーに体験してもらいたい効果ではありません。


デザインを考えると、複雑なダイアログではありません。ラベルとボタンだけが含まれています。以下に 1 つのサンプルを示します。

<Window x:Class="A_Boggle.Info"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Info" Height="300" Width="670" AllowsTransparency="True" WindowStyle="None" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" ShowInTaskbar="False" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Closing="Window_Closing">
<Grid>
    <Border Background="Transparent" Visibility="{Binding Visibility}">
        <Border BorderBrush="#FF7C4400" BorderThickness="4"
            CornerRadius="10,0,10,0" VerticalAlignment="Center"    HorizontalAlignment="Center" Height="177.5" Width="596.25">
            <Border.Background>
                <RadialGradientBrush Center="0.5,0.5" GradientOrigin="0.5,0.5" RadiusX="0.479" RadiusY="0.524">
                    <GradientStop Color="#FFF58611" Offset="0"/>
                    <GradientStop Color="#FFF58611" Offset="0.11798000335693359"/>
                    <GradientStop Color="#FFE9B231" Offset="1"/>
                </RadialGradientBrush>
            </Border.Background>
            <Border.BitmapEffect>
                <DropShadowBitmapEffect Color="Black" Opacity="0.5" Direction="270" ShadowDepth="0.7" />
            </Border.BitmapEffect>
            <Grid>
                <Separator Height="20" Name="separator1" Margin="8.75,0,6.25,45" VerticalAlignment="Bottom" />
                <Button Style="{DynamicResource OrangeButton}" Margin="406.25,0,6.25,6" Height="37.75" VerticalAlignment="Bottom" FontSize="16" Name="dialogButton" Click="dialogButton_Click"></Button>
                <Label FontFamily="Resources/#French Grotesque" FontSize="20" Foreground="#FF7C4400" Margin="8.75,20,6.25,71.25" Name="messageLabel"></Label>
            </Grid>
        </Border>
    </Border>
</Grid>

4

1 に答える 1

1

いいえ。ShowDialog での点滅は一般的な動作ではありません。最初に空のウィンドウで試していただけますか:

new Window().ShowDialog();

問題が解決しないかどうかを確認するには?

主なトピックは別として、WPF/XAML は、パフォーマンス上の理由から、複雑なゲームには適切なテクノロジではない可能性があります (ただし、単純なものであれば問題ありません)。

于 2010-10-17T13:24:04.820 に答える