我有一個DataGrid
在我的通用Windows平臺應用程序中綁定到ObservableCollection
。如何調試UWP xaml綁定?
加載頁面時,datagrid未顯示。我在同一個頁面中有另一個數據網格,它幾乎相同,但綁定到另一個集合幾乎與第一個集合相同(它具有綁定問題)。
有什麼方法可以調試XAML
文件嗎?
示例代碼:
<GridView Name="HourGridView" Grid.Row="4"
ItemsSource="{x:Bind ForeCastsByDates}"
Foreground="Chartreuse" >
<GridView.ItemTemplate>
<DataTemplate x:DataType="data:ForeCast">
.......
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
未綁定的集合:
private ObservableCollection<ForeCast> ForeCastsByDates;
是綁定以及收集:
private ObservableCollection<ForeCast> ForeCasts;
的ForeCastsByDates是預測的一部分:
ForeCastsByDates = new ObservableCollection<ForeCast>(ForeCasts.GroupBy(x => x.Date).Select(x => x.First()));
分享示例代碼 –
@VinothRajendran編輯我的帖子,帶有示例代碼 – axcelenator
'ForeCastsByDates'通知了屬性(而不是項目)上的更改嗎?否則,在ForeCastsByDates上做'set'操作發出通知,或者在ctor中設置集合一次,並使用'.Clear'和'.Add'作爲將來的適配。 –