本文整理汇总了C#中Windows.UI.Xaml.Controls.ListView.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.SetBinding方法的具体用法?C# ListView.SetBinding怎么用?C# ListView.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Controls.ListView
的用法示例。
在下文中一共展示了ListView.SetBinding方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitPivot
private void InitPivot()
{
var binding = new Binding { Source = ViewModel, Path = new PropertyPath("CurrentRecords") };
_itemTemplate = Resources["ListViewTemplate"] as DataTemplate;
foreach (var day in Enum.GetNames(typeof(DayOfWeek)))
{
var listView = new ListView
{
ItemTemplate = _itemTemplate,
IsItemClickEnabled = true
};
listView.ItemClick += ItemView_ItemClick;
listView.SetBinding(ItemsControl.ItemsSourceProperty, binding);
var pivotItem = new PivotItem { Header = day, Name = day, Content = listView };
pivot.Items.Add(pivotItem);
}
}
示例2: GetZoomedInView
private ISemanticZoomInformation GetZoomedInView()
{
var view = new ListView
{
ItemTemplate = ItemTemplate,
GroupStyle = // ListView.GroupStyle is a collection, yes...
{
new GroupStyle
{
HeaderTemplate = GetGroupHeaderTemplate()
}
},
// HACK: The group header template contains a top margin, so we cancel the first one here
Padding = new Thickness( 0, ZoomedInViewTopMargin - ZoomedInGroupFooterSize, 0, 0 )
};
// Weird way CollectionViewSources have to be used
view.SetBinding
(
ListView.ItemsSourceProperty,
new Binding { Source = ItemsViewSource }
);
view.SetBinding
(
ListView.SelectedItemProperty,
new Binding { Source = this, Path = new PropertyPath( "SelectedItem" ) }
);
return view;
}
示例3: GetZoomedOutView
private ISemanticZoomInformation GetZoomedOutView()
{
var view = new ListView
{
ItemTemplate = GetGroupItemTemplate(),
Foreground = ZoomedOutForegroundBrush,
Background = ZoomedOutBackgroundBrush,
Padding = ZoomedOutViewPadding
};
// weird way CollectionViewSources have to be used
view.SetBinding
(
ListView.ItemsSourceProperty,
new Binding { Source = ItemsViewSource, Path = new PropertyPath( "CollectionGroups" ) }
);
view.SetBinding
(
ListView.SelectedItemProperty,
new Binding { Source = this, Path = new PropertyPath( "SelectedItem" ) }
);
return view;
}