【发布时间】:2011-01-15 09:13:43
【问题描述】:
我已经绑定了窗口的Height 和Width。现在,Visual Studio 中的窗口太小了,我不能再处理它了。将默认值设置为 Height 和 Width 可以解决我的问题。 Binding可以吗?
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="Sth.MainWindow"
x:Name="Window"
Width="{Binding Path=WidthOfImage, Mode=TwoWay}"
Height="{Binding Path=HeightOfImage, Mode=TwoWay}"
>
...
</Window>
我们可以在 WPF Binding 中设置默认值吗?怎么样?
【问题讨论】:
标签: .net wpf data-binding default-value