本文整理汇总了C#中System.Windows.Controls.Primitives.StatusBar.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# StatusBar.SetValue方法的具体用法?C# StatusBar.SetValue怎么用?C# StatusBar.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Primitives.StatusBar
的用法示例。
在下文中一共展示了StatusBar.SetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeComponent
private void InitializeComponent(Configuration cfg)
{
this.Width = 1024;
this.Height = 768;
Button btnNew = NewImageButton(ApplicationCommands.New, "New", "New(Ctrl-N)", "New_16x16.png");
Button btnOpen = NewImageButton(ApplicationCommands.Open, "Open", "Open(Ctrl-O)", "Open_16x16.png");
Button btnSave = NewImageButton(ApplicationCommands.Save, "Save", "Save(Ctrl-S)", "Save_16x16.png");
Button btnExecute = NewImageButton(ExecuteCommand, "Execute", "Execute(F5)", "Next_16x16.png");
DockPanel dockPanel = new DockPanel();
this.Content = dockPanel;
//Tool bar
ToolBarTray tray = new ToolBarTray();
tray.SetValue(DockPanel.DockProperty, Dock.Top);
dockPanel.Children.Add(tray);
ToolBar toolBar;
tray.ToolBars.Add(toolBar = new ToolBar());
toolBar.Items.Add(btnNew);
toolBar.Items.Add(btnOpen);
toolBar.Items.Add(btnSave);
tray.ToolBars.Add(toolBar = new ToolBar());
toolBar.Items.Add(btnExecute);
//status bar
StatusBar statusBar = new StatusBar { Height = 20 };
statusBar.Items.Add(new StatusBarItem { Content = lblMessage, HorizontalAlignment = HorizontalAlignment.Left });
statusBar.Items.Add(new StatusBarItem { Content = lblCursorPosition, HorizontalAlignment = HorizontalAlignment.Right });
statusBar.Items.Add(new StatusBarItem { Content = lblRowCount, HorizontalAlignment = HorizontalAlignment.Right });
statusBar.SetValue(DockPanel.DockProperty, Dock.Bottom);
dockPanel.Children.Add(statusBar);
#region editor and results
Grid grid = new Grid();
grid.RowDefinitions.Add(new RowDefinition());
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(5) });
grid.RowDefinitions.Add(new RowDefinition());
dockPanel.Children.Add(grid);
textBox.Foreground = cfg.GetSolidBrush("gui.sql.editor.Foreground", Colors.Black);
textBox.Background = cfg.GetSolidBrush("gui.sql.editor.Background", Colors.White);
//Paragraph space
Style style = new Style { TargetType = typeof(Paragraph) };
style.Setters.Add(new Setter { Property = Block.MarginProperty, Value = new Thickness(0) });
textBox.Resources.Add(typeof(Paragraph), style);
GridSplitter splitter = new GridSplitter { Height = 5, HorizontalAlignment = HorizontalAlignment.Stretch };
tabControl.Foreground = cfg.GetSolidBrush("gui.sql.editor.Foreground", Colors.Black);
tabControl.Background = cfg.GetSolidBrush("gui.sql.editor.Background", Colors.White);
textBox.SetValue(Grid.RowProperty, 0);
splitter.SetValue(Grid.RowProperty, 1);
tabControl.SetValue(Grid.RowProperty, 2);
grid.Children.Add(textBox);
grid.Children.Add(splitter);
grid.Children.Add(tabControl);
#endregion
CommandBinding binding;
RoutedUICommand[] commands = new RoutedUICommand[]
{
ApplicationCommands.New,
ApplicationCommands.Open,
ApplicationCommands.Save,
ExecuteCommand
};
foreach (var cmd in commands)
{
binding = new CommandBinding(cmd);
binding.Executed += commandExecute;
binding.CanExecute += commandCanExecute;
this.CommandBindings.Add(binding);
}
}