我正在尋找在數據可用時選擇第一個項目的方法。但如果源中沒有數據,則不要選擇。怎麼做 ?我對WPF很陌生。當數據可用時,Comboxbox自動選擇第一個項目
<ComboBox Grid.Row="5" Grid.Column="1"
IsEditable="False"
ItemsSource="{Binding Source={x:Static l:DirectXResolution.Resolutions}}"
ToolTip="Resolutions">
<ComboBox.Resources>
<l:ResolutionConverter x:Key="resolutionConverter"/>
</ComboBox.Resources>
<ComboBox.Text>
<MultiBinding Converter="{StaticResource resolutionConverter}">
<Binding Path="GameWidth" Mode="OneWayToSource"/>
<Binding Path="GameHeight" Mode="OneWayToSource"/>
</MultiBinding>
</ComboBox.Text>
</ComboBox>
是否有任何種類的Itemssource(Resolutions)可用的更改通知? – RQDQ
該商品來源僅限於列表。不知道它是否有更改通知。如何添加更改通知? –