-2
내 XAML 코드wpf에서 다중 선택 콤보 박스에 여러 개의 체크 된 항목을 표시하는 방법은 무엇입니까?
<ComboBox HorizontalContentAlignment="Left"
x:Name="Stat"
IsEditable="True"
Width="247"
HorizontalAlignment="Left"
IsReadOnly="True"
ItemsSource="{Binding OrderStatus,Mode=TwoWay}"
Text="{Binding StatusSelectedValue}"
Height="26">
<ComboBox.ItemTemplate>
<DataTemplate>
<CheckBox Content="{Binding Description}"
IsChecked="{Binding IsChecked}"
Checked="CheckBox_Checked"
Unchecked="CheckBox_Unchecked"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
xaml.cs
가 // 내가 항목을 선택 또는
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
var selectedItem = sender as CheckBox ;
var r= selectedNode.IsChecked.Value;
선택하지 않은 경우 텍스트 내 다중 선택 콤보 상자에 표시 업데이 트하려는 // 모든 체크 항목의 가치를 얻으려고하고 그것을 연결하고 콤보 상자에 아래처럼 텍스트를 표시하십시오.
Stat.Text = String.Join(",",selectedItemValues.toArray());//this line of code is for example only for what i want to do
}
mvvm way 또는 xaml.cs 방법에 대한 도움이 있으면 대단히 감사하겠습니다.