Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6234989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:35:35+00:00 2026-05-24T10:35:35+00:00

I have the following simple code (see below) I copied from a book. But

  • 0

I have the following simple code (see below) I copied from a book. But I have a couple of questions about the line <Grid TextBlock.FontSize="48">.

  1. From what I gather, TextBlock.FontSize is an attached property but I initially thought that attached properties were meant to reference parent objects (i.e. when the Grid.Row attached property references the parent Grid element). But from how it is used here it may be that my understanding is incorrect? Is this an attached property and if so can it be used for child elements?

  2. Second, TextBlock.FontSize is set on the grid. But, no where in the xaml do I use a TextBlock element (that I know of). I only used Buttons with Content defined. Yet if I change the TextBlock.FontSize to a different value the font size changes. Therefore, how is TextBlock.FontSize being used? Where is the TextBlock?

Thank you in advance.

<Window x:Class="UseAGrid.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid TextBlock.FontSize="48">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="250" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Button Grid.RowSpan="2"
                Content="2 Rows" />
            <GridSplitter Grid.Row="0"
                          Grid.RowSpan="2"
                          Grid.Column="1"
                          Width="1"
                          Background="Green"
                          ResizeBehavior="PreviousAndNext"
                          ResizeDirection="Columns" />
        <Button Grid.Column="2"
                Grid.ColumnSpan="2"
                Content="2 Columns" />
        <Button Grid.Row="1"
                Grid.Column="2"
                Content="1,2" />
        <Button Grid.Row="1"
                Grid.Column="3"
                Content="1,3" />
    </Grid>
</Window>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:35:36+00:00Added an answer on May 24, 2026 at 10:35 am

    TextBlock.FontSize is not an attached property, it’s just a regular dependency property. The MSDN documentation is pretty good at listing attached properties for a control and FontSize is not one of them (it doesn’t even have any).

    It is however an inheritable property. Look at the dependency property information for it and you’ll see that it inherits its value. What this allows us to do is set the value of the property in an ancestor and all descendant controls that relies on this property will inherit the same value as long as they don’t explicitly set the value to something else.

    The controls it applies to doesn’t have to be explicitly instantiated by you, it also applies to styles, templates, content presenters, etc. So in your case, the content of your buttons is text so the TextBlocks used to display that text will also inherit the font size.

    See Property Value Inheritance for more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple application with the following code: FileInfo[] files = (new DirectoryInfo(initialDirectory)).GetFiles();
I have a simple 3D cube that I can rotate using the following code:
I have the following sample code where I download a pdf from the European
Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);
We have the following simple Stored Procedure that runs as an overnight SQL server
I have the following simple button with an image as the template. The problem
Let's say I have the following simple enum: enum Response { Yes = 1,
Let's say I have the following simple table variable: declare @databases table ( DatabaseID
I have written the following simple test in trying to learn Castle Windsor's Fluent
I have the following very simple Javascript-compatible regular expression: <script type=text/javascript id=(.+) src=([^]+)> I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.