привета в моем виде файл (adminentitylist.xaml) содержит код нижегалочки события не стрельбы в МОФ
<ResourceDictionary xmlns:local="clr-namespace:iWatch.Administration"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:my="clr-namespace:iWatch.UILibrary;assembly=UILibrary"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:cmd="clr-namespace:iWatch.UILibrary;assembly=UILibrary"
x:Class="AdminEntityList">
<ControlTemplate x:Key="AddImgBtnTemplate" TargetType="Button">
<Grid>
<Image Name="Normal" Source="/UILibrary;component/Themes/Default/Images/Add.png" Opacity="1.0" Height="18" Width="18"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Normal" Property="Opacity" Value="0.5"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Normal" Property="Opacity" Value="0.2"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="DelImgBtnTemplate" TargetType="Button">
<Grid>
<Image Name="Normal" Source="/UILibrary;component/Themes/Default/Images/Delete.png" Opacity="1.0" Height="18" Width="18"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Normal" Property="Opacity" Value="0.5"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Normal" Property="Opacity" Value="0.2"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style TargetType="{x:Type local:AdminEntityList}">
<Setter Property="FontFamily" Value="Calibri"/>
<Setter Property="dx:ThemeManager.ThemeName" Value="Office2007Black"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:AdminEntityList}">
<DockPanel>
<DockPanel DockPanel.Dock="Top">
<StackPanel Name="StpFilter" Orientation="Horizontal" HorizontalAlignment="Left" Margin="5">
<ContentControl x:Name="FilterCriteriaArea" ContentTemplate="{TemplateBinding FilterCriteriaArea}"/>
</StackPanel>
<StackPanel Name="StpCountry" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5" >
<Label Content="Select Country" Name="lblCountry" Style="{StaticResource lblNormal}" Margin="10,0,5,7" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Visibility="Collapsed"/>
<ComboBox Name="cbCountry" Width="170" Style="{StaticResource ddlNormal}" SelectedValue="{Binding CountryKey,Mode=TwoWay}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,2,10,0" Visibility="Collapsed"/>
<Button Content="Filter" Name="btnFilter" Width="70" Height="23" Margin="0,0,10,0" Visibility="Collapsed"/>
</StackPanel>
<StackPanel Name="actinact" Orientation="Horizontal" HorizontalAlignment="Left" Margin="5">
<CheckBox Name="chkactive" Height="18" Content="Active" Checked="chkactive_Checked"></CheckBox>
<CheckBox Name="chkinactive" Height="18" Content="In-Active"/>
</StackPanel>
<StackPanel Name="StpAddDel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5">
<Button Name="BtnAdd" Height="20" Width="20" Margin="5,0" Template="{StaticResource AddImgBtnTemplate}" />
<Button Name="BtnDel" Height="20" Width="20" Margin="5,0" Template="{StaticResource DelImgBtnTemplate}" />
</StackPanel>
</DockPanel>
<DockPanel Name="AMLDP">
<dxg:GridControl Name="genericGrid" AutoPopulateColumns="true" ShowBorder="False"
DesignTimeDataSourceRowCount="50" DataSource="{Binding}"
Padding="0" Margin="0,0,0,0" IsManipulationEnabled="True" dx:ThemeManager.ThemeName="CPCEGridTheme">
<dxg:GridControl.Resources>
<ResourceDictionary x:Key="CPCEGridTheme" Source="/UILibrary;component/Themes/Default/Styles/DataGrid/CPCEGridTheme.xaml" />
</dxg:GridControl.Resources>
<dxg:GridControl.View>
<dxg:TableView x:Name="tblGeneric" MultiSelectMode="Row" AllowGrouping="True" ClipToBounds="True" AutoWidth="True"
ShowGroupPanel="False" ShowHorizontalLines="True" ShowVerticalLines="False" AllowMoveColumnToDropArea="False" AllowDrop="False"
IsGroupPanelMenuEnabled="False" AllowEditing="False" NavigationStyle="Cell" Margin="0"
GroupRowStyle="{StaticResource OddEvenRowStyle}" VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Standard" AllowHorizontalScrollingVirtualization="True"
RowStyle="{StaticResource OddEvenRowStyle}" CellStyle="{StaticResource FocusedCellStyle}">
<dxg:TableView.RowCellMenuCustomizations>
<dxb:BarButtonItem Name="ctmView" IsVisible="False" Content="View" Command="{x:Static cmd:CustomCommands.View}" />
<dxb:BarButtonItem Name="ctmEdit" IsVisible="True" Content="Edit" Command="{x:Static cmd:CustomCommands.Edit}" />
<dxb:BarButtonItem Name="ctmMIQ" IsVisible="False" Content="Manage Interview Questions" Command="{x:Static cmd:CustomCommands.ManageInterviewQuestions}" />
<dxb:BarButtonItem Name="ctmActivate" IsVisible="False" Content="Activate" Command="{x:Static cmd:CustomCommands.Activate}" />
<dxb:BarButtonItem Name="ctmCopyInterviewType" IsVisible="False" Content="Copy Interview Type" Command="{x:Static cmd:CustomCommands.CopyInterviewType}" />
<dxb:BarButtonItem Name="ctmAssignInvGroup" IsVisible="False" Content="Assign Investigative Group" Command="{x:Static cmd:CustomCommands.AssignInvestigativeGroup}" />
<dxb:BarButtonItem Name="ctmCopySelected" IsVisible="False" Content="Copy From Selected" Command="{x:Static cmd:CustomCommands.CopyInterviewTemplate}" />
</dxg:TableView.RowCellMenuCustomizations>
</dxg:TableView>
</dxg:GridControl.View>
<dxg:GridControl.CommandBindings>
<CommandBinding x:Name="cmdEdit" Command="{x:Static cmd:CustomCommands.Edit}" />
<CommandBinding x:Name="cmdView" Command="{x:Static cmd:CustomCommands.View}" />
<CommandBinding x:Name="cmdMIQ" Command="{x:Static cmd:CustomCommands.ManageInterviewQuestions}" />
<CommandBinding x:Name="cmdActivate" Command="{x:Static cmd:CustomCommands.Activate}" />
<CommandBinding x:Name="cmdCopyInterviewType" Command="{x:Static cmd:CustomCommands.CopyInterviewType}" />
<CommandBinding x:Name="cmdAssignInvestigativeGroup" Command="{x:Static cmd:CustomCommands.AssignInvestigativeGroup}" />
<CommandBinding x:Name="cmdCopySelected" Command="{x:Static cmd:CustomCommands.CopyInterviewTemplate}" />
</dxg:GridControl.CommandBindings>
</dxg:GridControl>
</DockPanel>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
в приведенной выше коде я создал галочку событие Checked="chkactive_Checked"
private void chkactive_Checked(object sender, RoutedEventArgs e)
{
}
но событие не срабатывает, и я получаю сообщение об ошибке
Ошибка 14 'AdminEntityList' не содержит определения для «chkactive_Checked» и не метод расширения «не chkactive_Checked» принимая первый аргумент типа «AdminEntityList» можно найти (вы пропали без вести с помощью директивы или ссылка на сборку?)
, пожалуйста, помогите мне проблема ...
Сделать метод защищенным или общедоступным. – leppie
Я пробовал с публикой и защищен, но это не сработает. – trinadh
Появляется, что обработчик событий не подключен. Это не в правильном коде. Щелкните правой кнопкой мыши xaml и перейдите к обработчику. Или щелкните правой кнопкой мыши и создайте обработчик. – Paparazzi