I want to set an application wide Value i.e. TextHeight (others as well) and I can't seem to find a reference. IOW, set the Text Height to a StaticResource in various styles, etc.
TIA
I want to set an application wide Value i.e. TextHeight (others as well) and I can't seem to find a reference. IOW, set the Text Height to a StaticResource in various styles, etc.
TIA
My brain hurts a little bit after reading that question. Let me answer as if I truly understand what you're asking.
<Application x:Class="WpfApplication1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
<Application.Resources>
<Style TargetType="TextBox">
<Setter Property="FontSize" Value="100"/>
</Style>
</Application.Resources>
</Application>
With clarification:
<Application x:Class="WpfApplication1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
StartupUri="Window1.xaml">
<Application.Resources>
<sys:Double x:Key="MyTextHeight">32</sys:Double>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource MyTextHeight}"/>
</Style>
</Application.Resources>
</Application>
notice line 4, then the new Double (also note that the type must match the type of the parameter--I originally tried sys:Int32 which resulted in some interesting unrelated exceptions).