protected override void OnActionExecuting(ActionExecutingContext filterContext) { Log.DebugFormat("START: {0}", filterContext.ActionDescriptor.ActionName); ViewBag.LayoutModel = new LayoutModel { ShowAdminMenu = Auth.CurrentActor.IsAdmin, TopMenu = TopMenu.GetTopMenu("TopMenu.First"), SecondTopMenu = TopMenu.GetTopMenu("TopMenu.Second"), Left = Text.TextModel("Layout.Left"), Right = Text.TextModel("Layout.Right"), TopRight = Text.TextModel("Layout.TopRight"), CurrentUser = Auth.CurrentActor, DefaultTitle = Site.CurrentSiteFriendlyName }; base.OnActionExecuting(filterContext); }
//Create Top Menu protected void SetTopMenu(HelpString helpString, string header) { _topPanel = new StackPanel { Orientation = Orientation.Horizontal }; _myGrid.Children.Add(_topPanel); Grid.SetRow(_topPanel, 0); Grid.SetColumn(_topPanel, 0); _menuButton = new Button { Width = 60, ToolTip = "Short Menu", BorderBrush = new SolidColorBrush(Colors.Black) }; _menuButton.ContextMenu = TopMenu.GetTopMenu(_currentUserName, header, helpString); var brush = new ImageBrush { ImageSource = new BitmapImage(new Uri("../../Images/top_menu.jpg", UriKind.Relative)) }; _menuButton.Background = brush; _menuButton.Click += MenuButton_Click; TextBlock headerTitle = new TextBlock { Text = "Talk Back", Width = _window.Width - 120, FontSize = 15, Background = new SolidColorBrush(Colors.DarkViolet), TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, Height = 30, }; Button minButton = new Button { Width = 30, Background = new SolidColorBrush(Colors.MediumVioletRed), Content = "___", BorderBrush = new SolidColorBrush(Colors.Black), BorderThickness = new Thickness(1) }; minButton.Click += MinButton_Click; _closeButton = new Button { Width = 30, Background = new SolidColorBrush(Colors.Brown), Content = "X", BorderBrush = new SolidColorBrush(Colors.Black) }; _closeButton.Click += CloseButton_Click; _topPanel.Children.Add(_menuButton); _topPanel.Children.Add(headerTitle); _topPanel.Children.Add(minButton); _topPanel.Children.Add(_closeButton); }