CS0542 C# 'Something': 成员名称不能与其封闭类型相同

CS0542 C# 'Something': member names cannot be the same as their enclosing type

我的connect.xaml代码:

<Page
    x:Class="test.Views.Connect"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:test.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <TextBlock HorizontalAlignment="Center" Text="Connect Coming Soon!" TextWrapping="Wrap" VerticalAlignment="Center" Height="105" Width="741" FontSize="72" FontFamily="Arial Rounded MT Bold"/>

    </Grid>
</Page>

我在 Connect.g.cs 中收到错误 CS0542:

CS0542 C# 'Connect': member names cannot be the same as their enclosing type

如有任何帮助,我将不胜感激。

方法 Connect 被假定为构造函数,因为它与 class 同名。由于它是自动生成的,因此重命名 class 可能更容易。