Dot-Net
WPF 綁定中的預設值
我已經綁定了我的視窗的
Height和。Width現在,Visual Studio 中的視窗太小了,我不能再處理它了。將預設值設置為HeightandWidth將解決我的問題。有可能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嗎?如何?
<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, FallbackValue=200}" Height="{Binding Path=HeightOfImage, Mode=TwoWay, FallbackValue=150}" > ... </Window>