本文整理汇总了C#中System.Windows.Controls.ScrollViewer.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# ScrollViewer.SetBinding方法的具体用法?C# ScrollViewer.SetBinding怎么用?C# ScrollViewer.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.ScrollViewer
的用法示例。
在下文中一共展示了ScrollViewer.SetBinding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPropertiesPanel
//.........这里部分代码省略.........
Button PDMSubButton = new Button();
PDMSubButton.Content = "Show";
PDMSubButton.Style = App.Current.FindResource("PanelButtonStyle") as Style;
PDMSubButton.Width = 100;
PDMSubButton.Height = 20;
PDMSubButton.Click += btnPDMShow_Click;
PDMSubPanel.Children.Add(PDMSubButton);
TextBox txtT1 = new TextBox();
txtT1.MinWidth = 45;
txtT1.Height = 25;
txtT1.Name = "txtT1";
TextBox txtT2 = new TextBox();
txtT2.MinWidth = 45;
txtT2.Height = 25;
txtT2.Name = "txtT2";
this.RegisterName("txtT1", txtT1);
this.RegisterName("txtT2", txtT2);
PDMSubPanel.Children.Add(txtT1);
PDMSubPanel.Children.Add(txtT2);
PDMPanel.Children.Add(PDMSubPanel);
panel.Children.Add(PDMPanel);
///
/// Wavelet Panel
///
WrapPanel waveletPanel = new WrapPanel();
waveletPanel.Orientation = Orientation.Vertical;
waveletPanel.Margin = new Thickness(3);
waveletPanel.Background = Brushes.Gainsboro;
DockPanel.SetDock(waveletPanel, Dock.Top);
DockPanel dockPanel = new DockPanel();
dockPanel.Children.Add(waveletPanel);
ScrollViewer scv = new ScrollViewer();
scv.Content = dockPanel;
Binding scvHeightBinding = new Binding();
scvHeightBinding.Source = App.Current.MainWindow;
scvHeightBinding.Path = new PropertyPath("Height");
scvHeightBinding.Converter = new HeightConverter();
scv.SetBinding(HeightProperty, scvHeightBinding);
Label lblHeader = new Label();
lblHeader.Content = "Wavelet tranform";
lblHeader.FontWeight = FontWeights.Black;
waveletPanel.Children.Add(lblHeader);
for (int i = 0; i < args.WaveletLevels; ++i)
{
Label lbl = new Label();
lbl.Content = "Level " + (i + 1).ToString();
waveletPanel.Children.Add(lbl);
StackPanel localPanel = new StackPanel();
localPanel.Orientation = Orientation.Horizontal;
if (args.WaveletCounted[i] == true)
{
Button btnShow = new Button();
btnShow.Click += btnWavletShowClick;
btnShow.Name = "btnWaveletShow_" + (i + 1).ToString();
if (args.WaveletShown[i] == false)
btnShow.Content = "Show";
else
btnShow.Content = "Hide";
btnShow.Style = App.Current.FindResource("PanelButtonStyle") as Style;
btnShow.Width = 100;
btnShow.Height = 20;
localPanel.Children.Add(btnShow);
Button btnOpen = new Button();
btnOpen.Click += btnWavletOpenClick;
btnOpen.Name = "btnWaveletShow_" + (i + 1).ToString();
btnOpen.Content = "Open";
btnOpen.Style = App.Current.FindResource("PanelButtonStyle") as Style;
btnOpen.Width = 100;
btnOpen.Height = 20;
localPanel.Children.Add(btnOpen);
}
else
{
Button btn = new Button();
btn.Click += btnWaveletCount_Click;
btn.Name = "btnWaveletCount_" + (i + 1).ToString();
btn.Content = "Count";
btn.Style = App.Current.FindResource("PanelButtonStyle") as Style;
btn.Width = 100;
btn.Height = 20;
localPanel.Children.Add(btn);
}
waveletPanel.Children.Add(localPanel);
}
//panel.Children.Add(waveletBasePanel);
panel.Children.Add(scv);
return panel;
}