Click here to Skip to main content
15,898,850 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<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>

the gridline style propert i want to write in my .cs file in c# for my y axis how to doit.
C#
parentchart.Axes.Add(new LinearAxis() { Minimum = 0, Title = "Y Axis Name",ShowGridLines=true, Interval=70,   Orientation = AxisOrientation.Y, Maximum = ymax > 0 ? ymax : 300});

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

1 solution

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
 
Share this answer
 
Comments
kumar9avinash 11-Nov-13 7:16am    
pardon :)
kumar9avinash 11-Nov-13 7:20am    
i just want o set the property of y axis using c# code ,which i have done for x axis through xaml.
Andreas Gieriet 11-Nov-13 10:20am    
If your xaml file is called MyView.xaml, you find after compiling the project the generated c# file in obj\MyView.g.cs. Reverse engineer means: have a look how it is done there and do it similarly in your own code.
Cheers
Andi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900