wpf 问题,如何获得combobox中datatemplate下面的子节点 ,代码如下,我如何获得checkBox1这个控件呢 10
前台代码<ComboBoxx:Name="cmbPersons"SelectionChanged="cmbPersons_SelectionChanged"Margin=...
前台代码
<ComboBox x:Name="cmbPersons" SelectionChanged="cmbPersons_SelectionChanged" Margin="10,0" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" >
<ComboBox.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<CheckBox Content="{Binding DisplayName}" Name="checkBox1" Tag="{Binding ID}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" IsChecked="{Binding IsSelected,Mode=OneWay}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</StackPanel>
</ComboBoxItem.Content>
</ComboBoxItem>-->
</ComboBox> 展开
<ComboBox x:Name="cmbPersons" SelectionChanged="cmbPersons_SelectionChanged" Margin="10,0" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" >
<ComboBox.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<CheckBox Content="{Binding DisplayName}" Name="checkBox1" Tag="{Binding ID}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" IsChecked="{Binding IsSelected,Mode=OneWay}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</StackPanel>
</ComboBoxItem.Content>
</ComboBoxItem>-->
</ComboBox> 展开
1个回答
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询