{Binding DataContext.IsShowBurner,RelativeSource={RelativeSource AncestorType=UserControl}}
<StackPanel Orientation="Horizontal">
<CheckBox Content="自产气" HorizontalAlignment="Center" VerticalAlignment="Center"
IsChecked="{Bindin IsSelfProduceGas,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding DataContext.Enable,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/>
<CheckBox Margin="10,0,0,0" Content="外来气" HorizontalAlignment="Center" VerticalAlignment="Center"
IsChecked="{Binding IsForeignGas,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding DataContext.Enable,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/>
</StackPanel>
数据模板中绑定命令事件
<Button Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" Style="{StaticResource btnDeleteStyle}" Margin="5" ToolTip="删除"
Command="{Binding DataContext.DeleteInspectionAreaCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding}"></Button>
<Button Style="{StaticResource btnSave}" Visibility="{Binding IsShowSetting,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SettingValueCommand}" CommandParameter="{Binding}"></Button>
<CheckBox
Margin="10,0,0,0"
VerticalAlignment="Center"
Content="{Binding PlcFunctionName}"
IsChecked="{Binding IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.CheckedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=CheckBox}}" />
</i:EventTrigger>
<i:EventTrigger EventName="Unchecked">
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.UncheckedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=CheckBox}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</CheckBox>