我已经绑定了窗口的 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
中设置默认值吗?如何实现?