DataGrid 的 数据源 ItemsSource 模式Mode=OneWayToSource 会导致 ObservableCollection类型为null 而出现bug

1.在Datagrid绑定数据源时应该这样写

ItemsSource="{Binding Path=FrameContents}"

而不是

ItemsSource="{Binding Path=FrameContents,Mode=OneWayToSource}"

 

不然会出现 FrameContents,没有初始化为null的情况。

......

查下OneWayToSource模式的意义

posted @ 2018-06-30 22:53  <--青青子衿-->  阅读(247)  评论(0)    收藏  举报
// /**/ // 在页脚Html代码 引入 // function btn_donateClick() { var DivPopup = document.getElementById('Div_popup'); var DivMasklayer = document.getElementById('div_masklayer'); DivMasklayer.style.display = 'block'; DivPopup.style.display = 'block'; var h = Div_popup.clientHeight; with (Div_popup.style) { marginTop = -h / 2 + 'px'; } } function MasklayerClick() { var masklayer = document.getElementById('div_masklayer'); var divImg = document.getElementById("Div_popup"); masklayer.style.display = "none"; divImg.style.display = "none"; } setTimeout( function () { document.getElementById('div_masklayer').onclick = MasklayerClick; document.getElementById('btn_donate').onclick = btn_donateClick; var a_gzw = document.getElementById("guanzhuwo"); a_gzw.href = "javascript:void(0);"; $("#guanzhuwo").attr("onclick","follow('33513f9f-ba13-e011-ac81-842b2b196315');"); }, 900);