private void CreateActionBar(Grid layout) { var row = new RowDefinition(); row.Height = new GridLength(DisplayConstants.Dimensions.Forms.RdpSection.ActionBarHeight); layout.RowDefinitions.Add(row); var panel = new DockPanel(); panel.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.RdpSection.ActionBarBackgroundGrey); var thick = new Thickness(DisplayConstants.Dimensions.Forms.RdpSection.PaddingLeft, 0, DisplayConstants.Dimensions.Forms.RdpSection.PaddingRight, 0); panel.Margin = thick; Grid.SetRow(panel, 2); var border = BorderFactory.BevelFull(DisplayConstants.Colours.Borders.RdpSection.ActionBarBorder); border.Margin = thick; Grid.SetRow(border, 2); layout.Children.Add(panel); layout.Children.Add(border); }
private void CreateFormControlBar(Grid layout) { var borderTop = BorderFactory.BevelTop(DisplayConstants.Colours.Borders.BevelBorderLight); var borderBot = BorderFactory.BevelBottom(DisplayConstants.Colours.Borders.BevelBorderDark); var formActionBar = new DockPanel(); formActionBar.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.StandardBackgroundGrey); var row = new RowDefinition(); row.Height = new GridLength(DisplayConstants.Dimensions.Forms.FormControlBarHeight); layout.RowDefinitions.Add(row); Grid.SetRow(formActionBar, 2); Grid.SetColumn(formActionBar, 0); Grid.SetColumnSpan(formActionBar, ColumnCount); layout.Children.Add(formActionBar); Grid.SetRow(borderBot, 2); Grid.SetColumn(borderBot, 0); Grid.SetColumnSpan(borderBot, ColumnCount); Grid.SetRow(borderTop, 2); Grid.SetColumn(borderTop, 0); Grid.SetColumnSpan(borderTop, ColumnCount); layout.Children.Add(borderTop); layout.Children.Add(borderBot); }
public override Window Fabricate() { var window = new Window(); window.Height = DisplayConstants.Dimensions.Forms.WindowHeight; window.Width = DisplayConstants.Dimensions.Forms.WindowWidth; window.SnapsToDevicePixels = true; var bc = new BrushConverter(); var mgrid = new Grid(); //mgrid.ShowGridLines = true; mgrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(DisplayConstants.Dimensions.Forms.SectionSelectionPaneWidth) }); mgrid.ColumnDefinitions.Add(new ColumnDefinition()); mgrid.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.StandardBackgroundGrey); CreateBanner(mgrid); CreateMainActionBar(mgrid); CreateFormControlBar(mgrid); CreateSectionSelectionPane(mgrid); CreateSection(mgrid); window.Content = mgrid; return(window); }
private void CreateSectionSelectionPane(Grid layout) { var row = new RowDefinition(); row.Height = GridLength.Auto; layout.RowDefinitions.Add(row); var border = BorderFactory.BevelRight(DisplayConstants.Colours.Borders.BevelBorderDark); Grid.SetRow(border, 3); Grid.SetColumn(border, 0); var selectionPane = new StackPanel(); selectionPane.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.StandardBackgroundGrey); selectionPane.Height = 900; Grid.SetRow(selectionPane, 3); Grid.SetColumn(selectionPane, 0); for (int i = 0; i < 4; i++) { CreateSectionSelector(selectionPane); } layout.Children.Add(selectionPane); layout.Children.Add(border); }
private void CreateTableHeader(Grid superGrid) { var rowDef = new RowDefinition(); rowDef.Height = new GridLength(DisplayConstants.Dimensions.Forms.SuperGrid.TableHeaderHeight); superGrid.RowDefinitions.Add(rowDef); for (int i = 0; i <= 6; i++) { var dockPanel = new DockPanel(); var brush = EasyColour.LinearGradientBrushFromHex(DisplayConstants.Colours.GridView.HeaderRowGradientStart, DisplayConstants.Colours.GridView.HeaderRowGradientEnd, 90.0); dockPanel.Background = brush; Grid.SetRow(dockPanel, 0); Grid.SetColumn(dockPanel, i); var borderTop = BorderFactory.BevelTop(SuperGridColours.HeaderRowBorderTop); Grid.SetRow(borderTop, 0); Grid.SetColumn(borderTop, i); var borderBot = BorderFactory.BevelBottom(SuperGridColours.HeaderRowBorderBottom); Grid.SetRow(borderBot, 0); Grid.SetColumn(borderBot, i); var borderRight = BorderFactory.BevelRight(SuperGridColours.HeaderRowBorderBottom); Grid.SetRow(borderRight, 0); Grid.SetColumn(borderRight, i); var borderLeft = BorderFactory.BevelLeft(SuperGridColours.HeaderRowBorderLeft); Grid.SetRow(borderLeft, 0); Grid.SetColumn(borderLeft, i); superGrid.Children.Add(dockPanel); superGrid.Children.Add(borderTop); superGrid.Children.Add(borderBot); superGrid.Children.Add(borderRight); superGrid.Children.Add(borderLeft); var label = Labels.SuperGridTitle(); EasyLayout.SetPosition(superGrid, label, 0, i); var split = new GridSplitter(); split.HorizontalAlignment = HorizontalAlignment.Right; split.ResizeDirection = GridResizeDirection.Columns; split.Background = new SolidColorBrush(Colors.Transparent); split.Width = 5; EasyLayout.SetPosition(superGrid, split, 0, i); } }
public static Border BevelBottom(string colour) { var border = new Border(); border.BorderBrush = EasyColour.BrushFromHex(colour); border.BorderThickness = new Thickness(DisplayConstants.Dimensions.Borders.BevelBorderThickness); border.Height = DisplayConstants.Dimensions.Borders.BevelBorderThickness; border.VerticalAlignment = VerticalAlignment.Bottom; return(border); }
public static UIElement BevelLeft(string colour) { var border = new Border(); border.BorderBrush = EasyColour.BrushFromHex(colour); border.BorderThickness = new Thickness(DisplayConstants.Dimensions.Borders.BevelBorderThickness); border.Width = DisplayConstants.Dimensions.Borders.BevelBorderThickness; border.HorizontalAlignment = HorizontalAlignment.Left; return(border); }
public static Border BevelFull(string colour) { var border = new Border(); border.BorderBrush = EasyColour.BrushFromHex(colour); border.BorderThickness = new Thickness(DisplayConstants.Dimensions.Borders.BevelBorderThickness); border.HorizontalAlignment = HorizontalAlignment.Stretch; border.VerticalAlignment = VerticalAlignment.Stretch; return(border); }
private void CreateBanner(Grid layout) { var bar = new DockPanel(); bar.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.BannerBackgroundBlack); var row = new RowDefinition(); row.Height = new GridLength(DisplayConstants.Dimensions.Forms.BannerHeight); Grid.SetRow(bar, 0); Grid.SetColumn(bar, 0); Grid.SetColumnSpan(bar, ColumnCount); layout.RowDefinitions.Add(row); layout.Children.Add(bar); }
private void CreateRows(Grid superGrid) { for (int i = 1; i <= 25; i++) { var rowDef = new RowDefinition(); rowDef.Height = new GridLength(DisplayConstants.Dimensions.Forms.SuperGrid.RowHeight); superGrid.RowDefinitions.Add(rowDef); for (int j = 0; j <= 6; j++) { var dp = new DockPanel(); if (i <= 20) { if (i % 2 != 0) { dp.Background = EasyColour.BrushFromHex(SuperGridColours.EvenRowGrey); } else { dp.Background = EasyColour.BrushFromHex(SuperGridColours.OddRowGrey); } } var border = BorderFactory.BevelTop(SuperGridColours.RowBorder); Grid.SetColumn(dp, j); Grid.SetRow(dp, i); Grid.SetColumn(border, j); Grid.SetRow(border, i); superGrid.Children.Add(dp); superGrid.Children.Add(border); if (j != 6 && i <= 20) { var borderRight = BorderFactory.BevelRight(SuperGridColours.RowBorder); Grid.SetColumn(borderRight, j); Grid.SetRow(borderRight, i); superGrid.Children.Add(borderRight); } } } }
public Grid Fabricate() { var contentGrid = new Grid(); contentGrid.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.PanelBackgroundWhite); // Title Bar : Row 0 var row = new RowDefinition(); row.Height = new GridLength(DisplayConstants.Dimensions.Forms.RdpSection.TitleBarHeight); contentGrid.RowDefinitions.Add(row); var title = Labels.SectionTitle(); EasyLayout.SetPosition(contentGrid, title, 0, 0); // Header Bar : Row 1 row = new RowDefinition(); row.Height = new GridLength(DisplayConstants.Dimensions.Forms.RdpSection.HeaderBarHeight); contentGrid.RowDefinitions.Add(row); var panel = new DockPanel(); panel.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.StandardBackgroundGrey); var thick = new Thickness(DisplayConstants.Dimensions.Forms.RdpSection.PaddingLeft, 0, DisplayConstants.Dimensions.Forms.RdpSection.PaddingRight, 0); panel.Margin = thick; Grid.SetRow(panel, 1); // Action Bar : Row 2 CreateActionBar(contentGrid); contentGrid.Children.Add(panel); // Content Grid : Row 3 row = new RowDefinition(); contentGrid.RowDefinitions.Add(row); CreateSuperGrid(contentGrid); return(contentGrid); }
public static TextBox SuperGridTitle() { var label = new TextBox(); label.FontFamily = Fonts.OpenSans; label.FontSize = Fonts.Size.SuperGridHeader; label.Foreground = EasyColour.BrushFromHex("#34282C"); label.Text = "Table Header"; label.VerticalAlignment = VerticalAlignment.Center; label.Background = null; label.BorderBrush = null; label.Padding = new Thickness(5, 0, 0, 0); label.BorderThickness = new Thickness(0, 0, 0, 0); RenderOptions.SetBitmapScalingMode(label, BitmapScalingMode.NearestNeighbor); TextOptions.SetTextFormattingMode(label, TextFormattingMode.Display); Setter effectSetter = new Setter(); effectSetter.Property = ScrollViewer.EffectProperty; effectSetter.Value = new DropShadowEffect { ShadowDepth = 1, Direction = 270, Color = Colors.White, Opacity = 1, BlurRadius = 0.0 }; Style dropShadowScrollViewerStyle = new Style(typeof(ScrollViewer)); dropShadowScrollViewerStyle.Setters.Add(effectSetter); label.Resources.Add(typeof(ScrollViewer), dropShadowScrollViewerStyle); label.IsReadOnly = true; label.MouseDoubleClick += clix; label.KeyUp += StopEditingTextBox; label.LostFocus += TextBoxLostFocus; return(label); }
public static TextBox SectionTitle() { TextBox l = new TextBox(); l.FontFamily = Fonts.OpenSans; l.Foreground = EasyColour.BrushFromHex(SectionTitleColour); l.FontSize = Fonts.Size.SectionTitle; l.Text = "Section Title"; l.Padding = new Thickness(11, 15, 0, 0); l.BorderBrush = null; l.BorderThickness = new Thickness(0, 0, 0, 0); //l.IsEnabled = false; l.HorizontalAlignment = HorizontalAlignment.Left; l.MouseDoubleClick += clix; l.KeyUp += StopEditingTextBox; //l.AcceptsReturn = true; l.LostFocus += TextBoxLostFocus; l.IsReadOnly = true; return(l); }
private void CreateMainActionBar(Grid layout) { var border = BorderFactory.BevelBottom(DisplayConstants.Colours.Borders.BevelBorderDark); var bar = new DockPanel(); bar.Background = EasyColour.BrushFromHex(DisplayConstants.Colours.Forms.MainActionBarBackgroundGrey); var row = new RowDefinition(); row.Height = new GridLength(DisplayConstants.Dimensions.Forms.MainActionBarHeight); Grid.SetRow(border, 1); Grid.SetColumn(border, 0); Grid.SetColumnSpan(border, ColumnCount); Grid.SetRow(bar, 1); Grid.SetColumn(bar, 0); Grid.SetColumnSpan(bar, ColumnCount); layout.RowDefinitions.Add(row); layout.Children.Add(bar); layout.Children.Add(border); }