当前位置: 首页>>代码示例>>C#>>正文


C# ListView.SetBinding方法代码示例

本文整理汇总了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);
            }

        }
开发者ID:nikolayev1990,项目名称:NativeTimetable,代码行数:18,代码来源:PivotPage.xaml.cs

示例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;
 }
开发者ID:ValentinMinder,项目名称:pocketcampus,代码行数:28,代码来源:GroupedListView.cs

示例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;
 }
开发者ID:ValentinMinder,项目名称:pocketcampus,代码行数:22,代码来源:GroupedListView.cs


注:本文中的Windows.UI.Xaml.Controls.ListView.SetBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。