2
我正在做一個應用程序在MVVM中,我是新的... 我有一個布爾字段,並希望顯示一個組合框用戶項目是/否但是當用戶選擇它,但在數據上下文值是1和0。 我有以下代碼:mvvm:我應該如何將布爾值綁定到組合框
<TextBlock Grid.Row="2" Grid.Column="2" Text="Batch Flag" Margin="5,0,0,0" />
<ComboBox Grid.Row="2" Grid.Column="3" x:Name="cboBtchFlg" SelectedItem="{Binding SelectedADM_M022.BtchFlg,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="5,0,0,2" Background="Transparent">
<ComboBoxItem Tag="1">True</ComboBoxItem>
<ComboBoxItem Tag="0">False</ComboBoxItem>
</ComboBox>