public void Launch() { StockApplicationWindow w = new StockApplicationWindow() { WindowBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_02") as Brush, TopPanelBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_04") as Brush, BottomPanelBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_02") as Brush, SideToolbarBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_05") as Brush, TopPanelHeight = 55, BottomPanelHeight = 65, TopStripHeight = 10, BottomStripHeight = 5, WindowHeaderIcon = (ImageSource) new ImageSourceConverter().ConvertFromString("./Images/Klingelnberg/Klingelnberg_Logo.png"), WindowHeader = "Klipper", ShowSideToolbar = true, WindowState = WindowState.Normal }; AppearanceManager.CurrentSkin = SkinType.OrangeOnBlack; w.WindowState = System.Windows.WindowState.Normal; w.Topmost = false; //Register and unregister events on MainConnector w.Closed += (s, e) => { MainConnector.Instance.HandleWindowClose(); }; _appWindow = w; MainConnector.Instance.Ui = w; MainConnector.Instance.Initialize(); w.Show(); }
public void Launch() { StockApplicationWindow w = new StockApplicationWindow() { WindowBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_02") as Brush, TopPanelBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_04") as Brush, BottomPanelBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_02") as Brush, SideToolbarBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_05") as Brush, TopPanelHeight = 55, BottomPanelHeight = 65, TopStripHeight = 10, BottomStripHeight = 5, WindowHeaderIcon = (ImageSource) new ImageSourceConverter().ConvertFromString("./Images/Klingelnberg/Klingelnberg_Logo.png"), WindowHeader = "Klipper", ShowSideToolbar = true, WindowState = WindowState.Normal }; LoadNavigator(w); LoadTopPanel(w); LoadBottomPanel(w); LoadSideToolbar(w); w.WindowState = System.Windows.WindowState.Maximized; w.Topmost = true; w.Show(); }
private void LoadBottomPanel(StockApplicationWindow w) { var b = w.BottomPanel; _textPanel = new MultiColorTextPanel() { IsSelectable = true, HorizontalAlignment = HorizontalAlignment.Left, HorizontalContentAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, VerticalContentAlignment = VerticalAlignment.Center, SelectedBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_05") as Brush, }; b.Content = _textPanel; _textPanel.IsSelectable = true; _textPanel.Clicked += (s, e) => { MessageBox.Show("Override action when clicked on text-panel, such as showing session log."); }; _textPanel.SetText("One can add application status here.", new SolidColorBrush(Colors.YellowGreen)); _textPanel.AddText(" Click to execute the registered action.", new SolidColorBrush(Colors.Orange)); }
private void LoadTopPanel() { TopPanel.Loaded += (s, e) => { //var iconSize = 35.0; //(Ui as StockApplicationWindow).TopToolContainer.Children.Add(GetToolbarButton("Krypton/Save", iconSize, () => { MessageBox.Show("Save drawing changes clicked."); }, "Save drawing changes")); TopLeftContainer = new StackPanel() { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center }; (Ui as StockApplicationWindow).TopToolContainer.Children.Add(TopLeftContainer); TopRightContainer = new StackPanel() { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center }; (Ui as StockApplicationWindow).TopToolContainer.Children.Add(TopRightContainer); TopPanel.UpdateLayout(); TopRightTextPanel = new MultiColorTextPanel() { IsSelectable = true, HorizontalAlignment = HorizontalAlignment.Right, HorizontalContentAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, VerticalContentAlignment = VerticalAlignment.Center, SelectedBackground = AppearanceManager.GetCurrentSkinResource("BackgroundBase_05") as Brush, }; TopRightTextPanel.IsSelectable = true; TopRightTextPanel.Clicked += (sender, args) => { MessageBox.Show("Popup current user info dialog!"); }; TopRightContainer.Children.Add(TopRightTextPanel); TopRightContainer.Children.Add(new VerticalSeparator()); if (SessionContext.CurrentSubject != null) { TopRightTextPanel.SetText(SessionContext.CurrentSubject.FirstName + " " + SessionContext.CurrentSubject.LastName, new SolidColorBrush(Colors.YellowGreen)); } }; }