I am trying to define column styles for grids across my application. There would be many different Text format's and numeric formats that I will have to define and I want the styles of columns of similar type to remain consistent. For instance the simplest example of this would be like as shown below. One defines a double format and one an int format. How can I define these styles within app.xaml then specify EditAsType to XamNumericEditor and then use one of these styles based on name or some other attribute?
<Style x:Name="DoubleStyle" TargetType="{x:Type igEditors:XamNumericEditor}">
<!--Right justify the value in the column for Numeric Editor-->
<Style x:Name="IntStyle" TargetType="{x:Type igEditors:XamNumericEditor}">
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="Format" Value="#,##0"/>
</Style>
Thanks for your sample it helped.
Hello,
Thank you for your post. I have been looking through it and I created a sample project for you with the functionality you need. Basically I copied your styles in the App.xaml file, but instead of setting their Names’ Properties I set their Keys, by which you can set them through the StaticResources of your application. All of this is shown in the sample I attached.Please let me know if you need further clarifications on this matter.
Looking forward for your reply.