當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。