如果我使用c#在winrt xaml列系列中固定列系列条宽度,如何对齐列系列条和独立轴

时间:2014-03-03 05:16:50

标签: c# winrt-xaml

如果使用c#在winrt xaml色谱柱系列中固定色谱柱系列条宽,如何对齐色谱柱系列条和独立轴

private static Style GetNewDataPointStyle( )
{
        Random ran = new Random();
        //Color background = Colors.Blue;

        Color background = Color.FromArgb(255, (byte)ran.Next(255), (byte)ran.Next(255), (byte)ran.Next(255));

        Style style = new Style(typeof(Control));
        Setter st1 = new Setter(Control.BackgroundProperty, new SolidColorBrush(background));
        Setter st2 = new Setter(Control.BorderBrushProperty, new SolidColorBrush(Colors.White));
        Setter st3 = new Setter(Control.BorderThicknessProperty, new Thickness(0));
        Setter st4 = new Setter(Control.HeightProperty, 0);
        Setter st5 = new Setter(Control.WidthProperty, 0);
        Setter st6 = new Setter(Control.MaxWidthProperty, 30);
        Setter st7 = new Setter(Control.MinWidthProperty, 30);

        //Setter st6 = new Setter(DataPoint.TemplateProperty, null); // causes exception
        style.Setters.Add(st1); style.Setters.Add(st2); style.Setters.Add(st3); style.Setters.Add(st4); style.Setters.Add(st5); style.Setters.Add(st6); style.Setters.Add(st7);
        return style;
    }

我的输出是:

enter image description here

0 个答案:

没有答案