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


C# ListView.SetBinding方法代码示例

本文整理汇总了C#中System.Windows.Controls.ListView.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.SetBinding方法的具体用法?C# ListView.SetBinding怎么用?C# ListView.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.ListView的用法示例。


在下文中一共展示了ListView.SetBinding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddModuleTab

        private void AddModuleTab(string name, out Grid grid, ListView inputIO, ListView outputIO)
        {
            TabControl moduleTab = new TabControl();
            moduleTab.Style = (Style)App.Current.Resources["TabControlStyle"];
            CopyFontData(this.tabItem1, moduleTab);

            TabItem operationTab = new TabItem();
            operationTab.Header = "OPERATION";
            operationTab.Height = 50;
            moduleTab.Items.Add(operationTab);

            TabItem inputIOListTab = new TabItem();
            inputIOListTab.Header = "INPUT IO LIST";
            moduleTab.Items.Add(inputIOListTab);
            inputIOListTab.Content = inputIO;

            TabItem outputIOListTab = new TabItem();
            outputIOListTab.Visibility = System.Windows.Visibility.Collapsed;
            outputIOListTab.Header = "OUTPUT IO LIST";
            moduleTab.Items.Add(outputIOListTab);
            outputIOListTab.Content = outputIO;
            Binding bd = new Binding("IsEnabledOutputIODirectControl");
            bd.Source = this;
            bd.Mode = BindingMode.OneWay;
            outputIO.SetBinding(ListView.IsEnabledProperty, bd);

            Grid operationGrid = CreateOperationGrid();
            ScrollViewer sv = new ScrollViewer();
            sv.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            operationTab.Content = sv;
            sv.Content = operationGrid;

            CopyFontData(this.tabItem1, operationTab);
            CopyFontData(this.tabItem1, inputIOListTab);
            CopyFontData(this.tabItem1, outputIOListTab);

            TabItem tabItem = new TabItem();
            tabItem.Height = 50;
            tabItem.Header = name;
            tabItem.Content = moduleTab;
            CopyFontData(this.tabItem1, tabItem);
            grid = operationGrid;

            tabControl1.Items.Add(tabItem);
        }
开发者ID:vesteksoftware,项目名称:VT8642,代码行数:45,代码来源:PageManual.xaml.cs

示例2: LoadTransmission

        private void LoadTransmission() {
            System.Uri resourceLocater = new System.Uri("/DataSpaceSync;component/TransmissionWPF.xaml", System.UriKind.Relative);
            UserControl wpf = Application.LoadComponent(resourceLocater) as UserControl;

            ListView = wpf.FindName("ListView") as ListView;
            Binding binding = new Binding();
            binding.Source = TransmissionList;
            ListView.SetBinding(ListView.ItemsSourceProperty, binding);
            ListView.SelectionChanged += ListView_SelectionChanged;

            OkButton = wpf.FindName("OkButton") as Button;

            Content = wpf;
        }
开发者ID:OpenDataSpace,项目名称:CmisSync,代码行数:14,代码来源:TransmissionWindow.cs


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