在类型“GroupBox”中找不到属性“Click”在网核 3.1 中

问题描述

我有一个 netcore 3.1 应用程序,想添加一个点击事件以扩展/收缩 GroupBox 的内容。

不幸的是,Visual Studio 从标题中抛出错误,指出 GroupBox 没有这样的事件,即使它在 Microsoft reference 中如此声明。

重现代码:

<UserControl x:Class="SoundStudio.Views.LibraryView.Library"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             <!-- xmlns:local="clr-namespace:SoundStudio.Views.LibraryView" -->
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <StackPanel>
        <Label Content="Library"></Label>
        <Button x:Name="ImportButton" Content="Import" Click="ImportButton_Click"></Button>
        <GroupBox Header="Filter V" x:Name="FilterGroupBox" Click="FilterGroupBox_Click">
            <!-- <local:Filterview></local:Filterview> -->
        </GroupBox>
    </StackPanel>
</UserControl>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)