本文整理汇总了C#中System.Windows.Controls.TextBlock.get_ActualWidth方法的典型用法代码示例。如果您正苦于以下问题:C# TextBlock.get_ActualWidth方法的具体用法?C# TextBlock.get_ActualWidth怎么用?C# TextBlock.get_ActualWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TextBlock
的用法示例。
在下文中一共展示了TextBlock.get_ActualWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawCurveTitle
private double DrawCurveTitle(Rectangle rc, PointData dpt1, PointData dpt2, string title, bool draw)
{
Point point3;
Point point4;
PointData data;
Point point = this.PointData2Point(dpt1, rc);
Point point2 = this.PointData2Point(dpt2, rc);
if (point.get_X() < point2.get_X())
{
point3 = point;
point4 = point2;
data = dpt1;
}
else
{
point3 = point2;
point4 = point;
data = dpt2;
}
Color color = _SilverlightHelper.ConvertToColor(dpt2.Color);
if (dpt1.DateTime > dpt2.DateTime)
{
color = _SilverlightHelper.ConvertToColor(dpt1.Color);
}
double rotationAngle = _SilverlightHelper.GetRotationAngle(point3, point4);
TextBlock block = new TextBlock();
int num2 = 100;
double num3 = 5.0;
block.SetValue(Canvas.TopProperty, point3.get_Y() + num3);
block.SetValue(Canvas.LeftProperty, point3.get_X() + num3);
block.SetValue(FrameworkElement.WidthProperty, (double) num2);
block.SetValue(FrameworkElement.HeightProperty, 50.0);
block.set_Width((double) num2);
block.set_Text(title);
block.set_FontSize(12.0);
block.set_FontFamily(new FontFamily("Arial"));
block.set_Foreground(new SolidColorBrush(color));
block.set_FontStyle(FontStyles.get_Normal());
block.set_FontWeight(FontWeights.get_Bold());
RotateTransform transform = new RotateTransform();
transform.set_Angle(-rotationAngle);
block.set_RenderTransform(transform);
block.set_TextAlignment(1);
if (draw)
{
this.CanvasRoot.get_Children().Add(block);
}
return (block.get_ActualWidth() + num3);
}