Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using Resource Dictionary to assign height in Xaml

Posted on 2008-10-08
2
Medium Priority
?
594 Views
Last Modified: 2013-11-26
Have a Resource Dictionary:
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--    Grid Colors -->
    <Color x:Key="grdSolidColorBrush" A="255" R="165" G="195" B="239" />
          :
    <Button  x:Key="btnStd"    Height="23"  Width="75"  />
    <Label   x:Key="lblStd"    Height="28"  Width="54"  />
    <Label   x:Key="lblStd_X2" Height="28"  Width="108" />
    <TextBox x:Key="txtStd"    Height="21"  Width="90"  />
          :
    <Thickness x:Key="TxtR3C2" Left="265" Right="0" Bottom="0" Top="62"  />

Want to use the Resource Dictionary to globally assign height and width of GUI Objects

This works -
        <Grid >
            <Grid.Background>
                <SolidColorBrush Color="{DynamicResource grdSolidColorBrush}" />
            </Grid.Background>
and brings down the desired Color, in that way, can change the color in one location and cascade it to all Xaml code.  Can also place Objects dynamically on form with Margin="{DynamicResource TxtR3C2}" "like" commands.

However, I can not seem to dynamically control the height and width of Objects.  Width="{DynamicResource txtStd.Width}" does not produce an Object with a Width of 90.

What am I missing?

Thank you in advanced

Marv
0
Comment
Question by:Marvin_Rowe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Author Comment

by:Marvin_Rowe
ID: 22670492
Answered own question - sorry

This works for a Button control but it sould apply to all

    <Style TargetType="Button" x:Key="btnStd" >
        <Setter Property="Height" Value="28" />
        <Setter Property="Width" Value="54" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
    </Style>
0
 

Accepted Solution

by:
Marvin_Rowe earned 0 total points
ID: 22670499
That's "should" not "sould"
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question