如何在C#中编写xaml代码 [英] how to programitacally write the xaml code in C#

查看:319
本文介绍了如何在C#中编写xaml代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<charting:LinearAxis Orientation="X"   x:Name="orty"  Maximum="{Binding Path=Text, ElementName=txtx,Mode=TwoWay}" Title="Ledmodule operating (mA)" ShowGridLines="True">
                        <charting:LinearAxis.GridLineStyle>
                            <Style TargetType="Line">
                                <Setter Property="Stroke" Value="Blue" />
                                <Setter Property="StrokeDashArray" Value="1,2" />
                            </Style>
                        </charting:LinearAxis.GridLineStyle>
                    </charting:LinearAxis>



我希望在c#中的.cs文件中写入网格线样式属性y轴如何操作。


the gridline style propert i want to write in my .cs file in c# for my y axis how to doit.

parentchart.Axes.Add(new LinearAxis() { Minimum = 0, Title = "Y Axis Name",ShowGridLines=true, Interval=70,   Orientation = AxisOrientation.Y, Maximum = ymax > 0 ? ymax : 300});



这里我想用C#代码设置网格线。

怎么做。


here i want to style my grid line in C# code.
how to do it.

推荐答案

XAML被编译成C#代码。您可以对 somename.g.cs 等文件进行反向工程。在项目中编译与XAML文件具有相同基本名称的所有文件后搜索。

干杯

Andi
XAML is compiled into C# code. You may reverse engineer somename.g.cs etc. files. Search after compiling in your project for all files that have the same base name as your XAML file.
Cheers
Andi


这篇关于如何在C#中编写xaml代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆