Height="{Binding Source=Self, Path=Width}"
Width="627"
这不起作用。首先,Height
得到的长度为Width
,但是当我改变Width
时,Height
不想改变。Wight和W to H的窗口装订高度
这里有什么问题?
Height="{Binding Source=Self, Path=Width}"
Width="627"
这不起作用。首先,Height
得到的长度为Width
,但是当我改变Width
时,Height
不想改变。Wight和W to H的窗口装订高度
这里有什么问题?
Height
和Width
定义了你希望你的元素的大小。
在渲染视觉效果的过程中,您的元素的可用尺寸是相对于其他尺寸计算的,ActualHeight
和ActualWidth
已更新。
Height
和Width
不会改变,因为这计算的结果,但如果Height
和Width
发生变更,ActualHeight
和ActualWidth
被重新计算。
更改您的Binding
路径以使用ActualWidth
并且您应该以方形结束。
Height="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
此代码不工作:( – user2209075 2013-04-04 07:13:59
源应该是RelativeSource – 2013-04-04 08:09:35
你应该使用RelativeSource
结合:
Height="{Binding ActualWidth,RelativeSource={RelativeSource Mode=Self}}"
这是合法的吗?因为我知道Mode意思是其他的东西,如果更详细地说它是绑定的一种方式(OneTime,TwoWay和eg),我可能会错。 – user2209075 2013-04-04 19:09:38
请注意,这里的模式是相对来源。你所谈论的模式与这一模式有不同的含义 – user1064519 2013-04-07 09:03:21
我真不明白你到底做。无论如何,看看这是否有助于高度=“{绑定ActualWidth,ElementName = WindowName}” – Jack 2013-04-03 23:04:14
我尝试克里特岛的行为与PokersStars Windows一样,他们改变第一参数没有第二,例如 – user2209075 2013-04-04 06:36:47