Не могу нажать на кнопку WPF - PullRequest
0 голосов
/ 13 апреля 2020
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Content="?" Click="MinimizeButton_Click" Background="Transparent" BorderThickness="0" />
            <Button Name="SizeChangeButton" Content="?" Click="SizeChangeButton_Click" Background="Transparent" BorderThickness="0" />
            <Button Content="X" Click="CloseButton_Click" Background="green" BorderThickness="0" />
        </StackPanel>

Не могу нажать кнопку. Единственное место, которое я могу нажать, это как 1 на бота кнопки. это весь код https://prnt.sc/rybgfv как сделать реагирование на клик размером кнопки?

ДОБАВИТЬ: код Xaml

<!-- AllowsTransparency="True" Background="Transparent" -->
<Window x:Class="Seafight_launcher.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Seafight_launcher"
        xmlns:cefsharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
        mc:Ignorable="d"
        WindowStyle="none"
        ShowInTaskbar="True"
        SizeChanged="Window_SizeChanged"
        Title="Launcher" Height="450" Width="800" >
    <!-- remove white strip on top -->
    <WindowChrome.WindowChrome>
        <WindowChrome GlassFrameThickness="0,0,0,1" CornerRadius="0" />
    </WindowChrome.WindowChrome>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height ="auto" />
            <RowDefinition Height = "*" />
        </Grid.RowDefinitions>
        <!-- Barre de titre-->
        <Grid Grid.Row="0" Name="titleBar" MouseDown="Drage_window">
            <Label HorizontalContentAlignment="Left" Content="Logo"/>
            <Label HorizontalContentAlignment="Center" Content="Launcher"/>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Right">
                <Button Content="?" Click="MinimizeButton_Click" Background="Transparent" BorderThickness="0" />
                <Button Name="SizeChangeButton" Content="?" Click="SizeChangeButton_Click" Background="Transparent" BorderThickness="0" />
                <Button Content="?" Click="CloseButton_Click" BorderThickness="0" Background="Transparent"/>
            </StackPanel>
        </Grid>
        <!-- interface -->
        <Grid Grid.Row="1" VerticalAlignment="Stretch">
            <!-- -->
            <cefsharp:ChromiumWebBrowser Address="http://pi.hole"/>
            <!-- -->
        </Grid>
    </Grid>
</Window>
...