private void SetGridText(string strataValue, TextBlockConfig textBlockConfig)
        {
            Grid grid = new Grid();

            grid = GetStrataGrid(strataValue);

            TextBlock txt = new TextBlock();

            txt.Text                = textBlockConfig.Text;
            txt.Margin              = textBlockConfig.Margin;
            txt.VerticalAlignment   = textBlockConfig.VerticalAlignment;
            txt.HorizontalAlignment = textBlockConfig.HorizontalAlignment;
            Grid.SetRow(txt, textBlockConfig.RowNumber);
            Grid.SetColumn(txt, textBlockConfig.ColumnNumber);
            grid.Children.Add(txt);
        }
 private void SetGridText(Grid grid, TextBlockConfig textBlockConfig)
 {
     TextBlock txt = new TextBlock();
     txt.Text = textBlockConfig.Text;
     txt.Margin = textBlockConfig.Margin;
     txt.VerticalAlignment = textBlockConfig.VerticalAlignment;
     txt.HorizontalAlignment = textBlockConfig.HorizontalAlignment;
     Grid.SetRow(txt, textBlockConfig.RowNumber);
     Grid.SetColumn(txt, textBlockConfig.ColumnNumber);
     grid.Children.Add(txt);
 }
        private void SetGridText(string strataValue, TextBlockConfig textBlockConfig, FontWeight fontWeight)
        {
            Grid grid = new Grid();

            grid = GetStrataGrid(strataValue);

            TextBlock txt = new TextBlock();
            txt.Text = textBlockConfig.Text;
            txt.Margin = textBlockConfig.Margin;
            txt.VerticalAlignment = textBlockConfig.VerticalAlignment;
            txt.HorizontalAlignment = textBlockConfig.HorizontalAlignment;
            txt.FontWeight = fontWeight;

            int rowNum = textBlockConfig.RowNumber;
            int colNum = textBlockConfig.ColumnNumber;

            if (colNum == 0 && rowNum > 0)
            {
                Rectangle rctHeader = new Rectangle();
                rctHeader.Style = this.Resources["gridHeaderCellRectangle"] as Style;
                Grid.SetRow(rctHeader, rowNum);
                Grid.SetColumn(rctHeader, 0);
                grid.Children.Add(rctHeader);
                txt.Style = this.Resources["columnHeadingText"] as Style;
            }

            if (colNum > 0)
            {
                StackPanel panel = new StackPanel();
                panel.Margin = new Thickness(2, 4, 2, 4);
                panel.Children.Add(txt);

                Grid.SetRow(panel, rowNum);
                Grid.SetColumn(panel, colNum);
                grid.Children.Add(panel);
            }
            else
            {
                Grid.SetRow(txt, rowNum);
                Grid.SetColumn(txt, colNum);
                grid.Children.Add(txt);
            }
        }
示例#4
0
 public void PortClassToClient77(TextBlockConfig gp)
 {
 }
        private void SetGridText(string strataValue, TextBlockConfig textBlockConfig, FontWeight fontWeight)
        {
            Grid grid = new Grid();

            grid = GetStrataGrid(strataValue);

            TextBlock txt = new TextBlock();
            txt.FontWeight = fontWeight;
            txt.Text = textBlockConfig.Text;
            txt.Margin = textBlockConfig.Margin;
            txt.VerticalAlignment = textBlockConfig.VerticalAlignment;
            txt.HorizontalAlignment = textBlockConfig.HorizontalAlignment;
            txt.TextAlignment = textBlockConfig.TextAlignment;
            txt.TextWrapping = TextWrapping.Wrap;
            txt.MaxWidth = 300;
            txt.Visibility = textBlockConfig.ControlVisibility;
            if (IsHostedByEnter)
            {
                txt.MouseEnter += new MouseEventHandler(rowDef_MouseEnter);
                txt.MouseLeave += new MouseEventHandler(rowDef_MouseLeave);
                txt.MouseUp += new MouseButtonEventHandler(rowDef_MouseUp);
            }
            Grid.SetZIndex(txt, 1000);
            Grid.SetRow(txt, textBlockConfig.RowNumber);
            Grid.SetColumn(txt, textBlockConfig.ColumnNumber);
            grid.Children.Add(txt);

            if (checkboxAllowUpdates.IsChecked == true)
            {
                //txt.MouseLeftButtonDown += new MouseButtonEventHandler(gridCell_MouseLeftButtonDown);
            }
        }
        private void SetGridImage(string strataValue, byte[] imageBlob, TextBlockConfig textBlockConfig, FontWeight fontWeight)
        {
            Grid grid = new Grid();

            grid = GetStrataGrid(strataValue);

            Image image = new Image();
            System.IO.MemoryStream stream = new System.IO.MemoryStream(imageBlob);
            BitmapImage bitmap = new BitmapImage();
            bitmap.BeginInit();
            bitmap.StreamSource = stream;
            bitmap.EndInit();
            image.Source = bitmap;
            image.Height = bitmap.Height;
            image.Width = bitmap.Width;

            if (IsHostedByEnter)
            {
                image.MouseEnter += new MouseEventHandler(rowDef_MouseEnter);
                image.MouseLeave += new MouseEventHandler(rowDef_MouseLeave);
                image.MouseUp += new MouseButtonEventHandler(rowDef_MouseUp);
            }
            Grid.SetZIndex(image, 1000);
            Grid.SetRow(image, textBlockConfig.RowNumber);
            Grid.SetColumn(image, textBlockConfig.ColumnNumber);
            grid.Children.Add(image);
        }
        private void SetGridText(string strataValue, TextBlockConfig textBlockConfig)
        {
            Grid grid = new Grid();

            grid = GetStrataGrid(strataValue);

            TextBlock txt = new TextBlock();
            txt.Text = textBlockConfig.Text;
            txt.Margin = textBlockConfig.Margin;
            txt.VerticalAlignment = textBlockConfig.VerticalAlignment;
            txt.HorizontalAlignment = textBlockConfig.HorizontalAlignment;
            Grid.SetRow(txt, textBlockConfig.RowNumber);
            Grid.SetColumn(txt, textBlockConfig.ColumnNumber);
            grid.Children.Add(txt);
        }