私は2つのアプリケーションにWindows
を持っています。そのうちの1つはMainWindow
で、もう1つは設定用です。 ShowDialog
を使用し、Owner
をMainWindow
に設定すると、設定ボタンをクリックするとSettingsWindow
が開きます。 SettingsWindow
でShowDialogとフチ無しのウィンドウを使用しているときにIsMouseOverトリガが機能しない
Iは、ウィンドウの最下部にあるボタンを有し、IsMouseOver
がFalse
ためTrue
と青色である場合には、赤色に色を変化させます。しかし、カーソルがMainWindow上にあるときは変更されません。画像は以下の通りです。この問題を解決するにはどうすればよいですか?
ケース:カーソルはSettingsWindowから外れていますが、赤色を維持しますが、変更はありません。
XAMLコード:
<Window x:Class="AltoSS.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="SettingsWindow"
Height="150"
Width="360"
WindowStyle="None"
AllowsTransparency="True"
WindowStartupLocation="CenterOwner">
<!-- Other control codes-->
<Button Grid.Row="2" Content="KAYDET"
FontSize="15"
FontWeight="Bold"
BorderBrush="Gray"
BorderThickness="0,2,0,2">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Background" Value="Blue"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
</Button>
</Window>
どのようにトリガーされますか?あなたのxamlを共有してください – Forlani
ああ、申し訳ありません。私はそれを追加することを忘れました。 Q: –
@jstreetを更新する予定です。境界線のないウィンドウを作成したいと思います。問題がAllowTransparencyである場合、どうすれば解決できますか? –