阅读背景:

WPF将DataGrid绑定到CollectionViewSource:通过DataContext工作,通过ItemsSource清空;区别?

来源:互联网 

Consider the following XAML:

考虑以下XAML:

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="clr-namespace:WpfApplication1"
    DataContext="{Binding Source={x:Static c:ViewModel.Instance}}"
    >
<Grid>
    <DataGrid DataContext="{Binding ItemsViewSource}" ItemsSource="{Binding}" />

</Grid>
<Win



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: