UWP:DataGrid + ProgressRing

问题描述 投票:0回答:1

错误CS0103当前上下文中不存在名称“Status”

为了使控制器在.cs文件中可用,正确的语法是什么?

<controls:DataGridTemplateColumn Header="OrderId">
    <controls:DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <Grid>
                <Grid.ContextFlyout>
                    <MenuFlyout>
                        <MenuFlyoutItem Text="Copy" Icon="Copy" Click="MenuFlyoutItem_Copy" />
                        <MenuFlyoutSeparator />
                        <MenuFlyoutItem Text="Delete" Icon="Delete" Click="MenuFlyoutItem_Delete" />
                    </MenuFlyout>
                </Grid.ContextFlyout>
                <TextBlock Text="{Binding OrderId}" />
                <ProgressRing x:Name="Status" Foreground="Green" IsActive="True" />
            </Grid>
        </DataTemplate>
    </controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
uwp datagrid xamarin.uwp windows-community-toolkit
1个回答
0
投票

我建议你最好使用Binding来控制ProgressRing的IsActive属性值。然后,您不需要在代码隐藏中获取控件实例。

<ProgressRing x:Name="Status" Foreground="Green" IsActive="{Binding xxx}" />
© www.soinside.com 2019 - 2024. All rights reserved.