I've updated the question with my xaml code. The problem is the listview, which is under a popup tag. Thank everyone for your help.
Xaml code
<Popup Name="black_list_seting"
StaysOpen="False"
AllowsTransparency="True"
Closed="emoj_closed"
PlacementTarget ="{Binding ElementName=emj_btn}"
Placement="Left">
<Border HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="0.5">
<Grid x:Name="black_list_grid" Width="270" Height="238" Background="White" ScrollViewer.VerticalScrollBarVisibility="Visible" >
<ListView x:Name="black_listview" HorizontalAlignment="Left" Height="219" Margin="10,10,0,0" VerticalAlignment="Top" Width="254" >
<ListView.View>
<GridView >
<GridView.ColumnHeaderTemplate>
<DataTemplate >
<DockPanel Margin="-40,0,0,0">
<TextBlock FontSize="12" HorizontalAlignment="Left" Foreground="#383e4b">
<TextBlock.Text>
<Binding/>
</TextBlock.Text>
</TextBlock>
</DockPanel>
</DataTemplate>
</GridView.ColumnHeaderTemplate>
<GridViewColumn Header="name"
DisplayMemberBinding="{Binding user_name}"
Width="100"/>
<GridViewColumn Header="ignore"
Width="100">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox DataContext="{Binding check_key}" IsChecked="{Binding IsSelected}" Checked="black_list_item_fn"></CheckBox>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Grid>
</Border>
</Popup>
Code behind
public class contact_user_data
{
public string user_name { get; set; }
public string user_key { get; set; }
public string check_key { get; set; }
public string head_url { get; set; }
private bool isSelected;
private string name;
public bool IsSelected { get; set; }
}
List view Itemssource definition code
var source = global_var.black_list_soruce[md5];
if (source != black_listview.ItemsSource)
{
}
black_listview.ItemsSource = null;
// black_listview.Items.Clear();
black_listview.ItemsSource = source;
black_list_seting.IsOpen = true;
No matter how I define the check box binding, it has been unchecked.
Please help me !! I spent three days researching this problem