XAML 无法将UWP应用DropDownButton添加到IGridList

pbgvytdp  于 2022-12-25  发布在  其他
关注(0)|答案(1)|浏览(136)

我试图创建一个飞出菜单为每个网格单元格,通过下拉按钮打开。但是,无论我尝试,我不能让它工作,甚至建立我应该说。
我的密码是

<DataTemplate>
                        <ViewCell>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="50"/>
                                </Grid.RowDefinitions>
                                <Label Grid.Column="2" Grid.Row="0" Text="1" />
                                <Label Grid.Column="3" Grid.Row="0" Text="2" />
                                <Label Grid.Column="4" Grid.Row="0" Text="3" HorizontalOptions="Start" />
                                <controls:DropDownButton Grid.Column="4" Grid.Row="0" HorizontalOptions="End"></controls:DropDownButton>

但得到的错误是XLS0503 A value of type 'DropDownButton' cannot be added to a collection or dictionary of type 'IGridList1'
之前是否需要添加一些父元素?

fafcakar

fafcakar1#

UWP应用程序没有 ViewGrid 元素。
WinUI3WinUI2中查找所有可用的GUI和布局元素
了解有关WinUI2 here的更多信息

相关问题