ウィンドウにグリッドとボタンを使用して、WPF アプリケーションを作成しました。ウィンドウの SizeChanged イベントで、Grid を scaleTransform してサイズを最大化しますが、縦横比は維持します。
マウスをボタンの上に移動すると、予想どおりホットトラックが発生しますが、マウスが0.5秒未満停止します。大きな問題ではありませんが、何かがおかしいようです.
編集 私は実際に質問したことはないと思います。私が知りたいのは。これは正常な動作ですか、それとも私がこれを行う方法に何か問題がありますか?
    //Store the initial size of the Grid
    double GridStartWidth;
    double GridStartHeight;
    public MainWindow()
    {
        InitializeComponent();
        //Get the values for the initial size of Grid
        GridStartWidth = MainGrid.Width;
        GridStartHeight = MainGrid.Height;
    }
    private void myMainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
    {
        double min = Math.Min(this.Height / GridStartHeight, this.Width / GridStartWidth);
        Transform tr = new ScaleTransform(min, min, .5, .5);
        MainGrid.LayoutTransform = tr;
    }
    private void button1_Click(object sender, RoutedEventArgs e)
    {
        Application.Current.Shutdown();
    }
Xamlが必要かどうかはわかりませんが、ここにあります
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" 
Name="myMainWindow"
Width="1280" Height="1024" SizeChanged="myMainWindow_SizeChanged" AllowsTransparency="True" Background="#4FFFFFFF" WindowStyle="None" WindowState="Maximized">
<Grid Name="MainGrid"  Background="#FF8DC78D" Width="800" Height="600">
    <Button Content="Exit" Height="23" HorizontalAlignment="Left" Margin="13,12,0,0" Name="ExitButton" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>
編集#2この問題を最初から複製して、機能を追加しながら段階的にテストしようとしました。この問題は、ウィンドウの状態を最大化に設定すると発生します。
EDIT #3別のテスト Allow Transparency プロパティを削除し、背景を単色に設定すると、正常に動作します。したがって、問題は透明な背景を持つ最大化されたウィンドウに関係しています。これは理にかなっていますか?