标签: rowdefinition

在 WPF 中,如何从属于它的 UIElement 获取 RowDefinition 对象?

以下面的窗口布局为例:Grid定义了一个元素。它有 3 行。每一行都有一个 Button 元素。如何获取RowDefinition它所属的 Button的对象?谢谢。

注意:通过调用Grid.GetRow(Button element),我获得了Grid.Row该 Button 元素的属性。我不需要那个——而是我需要实际的RowDefinition对象。

wpf grid uielement rowdefinition

3
推荐指数
1
解决办法
4840
查看次数

Xamarin 表单:RowDefinition height OnIdiom 属性的正确格式是什么?

我在网格内有 2 行,因为第一行具有固定大小。我正在尝试在这里应用该OnIdiom功能。尝试如下:

<Grid.RowDefinitions>
    <RowDefinition>
        <RowDefinition.Height>
            <OnIdiom x:TypeArguments="x:Double">
                <OnIdiom.Phone>30</OnIdiom.Phone>
                <OnIdiom.Tablet>60</OnIdiom.Tablet>
            </OnIdiom>
        </RowDefinition.Height>
    </RowDefinition>
    <RowDefinition Height="auto"/>
</Grid.RowDefinitions>
Run Code Online (Sandbox Code Playgroud)

但在错误列表中出现以下错误:

No property, bindable property, or event found for 'Height', or mismatching type between value and property.
Run Code Online (Sandbox Code Playgroud)

RowDefinition 高度 OnIdiom 属性的正确格式是什么?

grid rowdefinition xamarin.forms

1
推荐指数
1
解决办法
743
查看次数

标签 统计

grid ×2

rowdefinition ×2

uielement ×1

wpf ×1

xamarin.forms ×1