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