views:

281

answers:

1

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

+1  A: 

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).

Will
My appologies, end of an all-nighter. I want to have ... Value="{StaticResource MyTextHeight}"/>. So I want to be able to define MyTextHeight at the application resource level.Thanks again
Brad
My most sincere contrafibularities! Please take this check mark as a small token of my esteem.
Brad
Dude, lay off the coffee. Its addictive in large quantities.
Will
Not a BlackAdder fan? "I am anaspeptic, frasmotic, even compunctuous to have caused such pericombobulation."
Brad
I have no idea what you're talking about. For your efforts, though, here is a purse of moneys... that I'm not going to give you.
Will
Seeing somebody is a fan of Hugh Laurie usually means they watch House nowadays...
Will