Example #1
0
        private void CreateStorageBarInfo(string label, Brush color)
        {
            TextBlock block;
            Rectangle rectangle2 = new Rectangle {
                Height = 6.0,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Fill   = color,
                Margin = new Thickness(0.0, 0.0, 1.0, 0.0)
            };
            Rectangle      rectangle = rectangle2;
            StorageBarInfo info2     = new StorageBarInfo {
                Color = color,
                Bar   = rectangle
            };
            StorageBarInfo info = info2;

            info.Legend                 = CreateLegend(label, info, out block);
            info.LegendByte             = block;
            this.StorageBarInfos[label] = info;
        }
Example #2
0
        private static UIElement CreateLegend(string label, StorageBarInfo info, out TextBlock legendByte)
        {
            StackPanel panel3 = new StackPanel {
                Orientation = Orientation.Horizontal,
                Margin      = new Thickness(30.0, 0.0, 0.0, 30.0)
            };
            StackPanel panel      = panel3;
            Rectangle  rectangle2 = new Rectangle {
                Height              = 7.0,
                Width               = 7.0,
                Fill                = info.Color,
                VerticalAlignment   = VerticalAlignment.Top,
                Margin              = new Thickness(0.0, 6.0, 0.0, 0.0),
                SnapsToDevicePixels = true
            };
            Rectangle element = rectangle2;

            panel.Children.Add(element);
            StackPanel panel4 = new StackPanel {
                Orientation = Orientation.Vertical
            };
            StackPanel panel2 = panel4;

            panel.Children.Add(panel2);
            TextBlock block = new TextBlock {
                Text  = label,
                Style = Application.Current.Resources["storageLegend"] as Style
            };

            panel2.Children.Add(block);
            TextBlock block2 = new TextBlock {
                Style = Application.Current.Resources["storageLegendSubtext"] as Style
            };

            legendByte = block2;
            AutomationProperties.SetAutomationId(legendByte, GetAutomationId(label));
            panel2.Children.Add(legendByte);
            return(panel);
        }
 private void CreateStorageBarInfo(string label, Brush color)
 {
     TextBlock block;
     Rectangle rectangle2 = new Rectangle {
         Height = 6.0,
         HorizontalAlignment = HorizontalAlignment.Stretch,
         Fill = color,
         Margin = new Thickness(0.0, 0.0, 1.0, 0.0)
     };
     Rectangle rectangle = rectangle2;
     StorageBarInfo info2 = new StorageBarInfo {
         Color = color,
         Bar = rectangle
     };
     StorageBarInfo info = info2;
     info.Legend = CreateLegend(label, info, out block);
     info.LegendByte = block;
     this.StorageBarInfos[label] = info;
 }
 private static UIElement CreateLegend(string label, StorageBarInfo info, out TextBlock legendByte)
 {
     StackPanel panel3 = new StackPanel {
         Orientation = Orientation.Horizontal,
         Margin = new Thickness(30.0, 0.0, 0.0, 30.0)
     };
     StackPanel panel = panel3;
     Rectangle rectangle2 = new Rectangle {
         Height = 7.0,
         Width = 7.0,
         Fill = info.Color,
         VerticalAlignment = VerticalAlignment.Top,
         Margin = new Thickness(0.0, 6.0, 0.0, 0.0),
         SnapsToDevicePixels = true
     };
     Rectangle element = rectangle2;
     panel.Children.Add(element);
     StackPanel panel4 = new StackPanel {
         Orientation = Orientation.Vertical
     };
     StackPanel panel2 = panel4;
     panel.Children.Add(panel2);
     TextBlock block = new TextBlock {
         Text = label,
         Style = Application.Current.Resources["storageLegend"] as Style
     };
     panel2.Children.Add(block);
     TextBlock block2 = new TextBlock {
         Style = Application.Current.Resources["storageLegendSubtext"] as Style
     };
     legendByte = block2;
     AutomationProperties.SetAutomationId(legendByte, GetAutomationId(label));
     panel2.Children.Add(legendByte);
     return panel;
 }