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 6785317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:06:43+00:00 2026-05-26T17:06:43+00:00

I am working on Windows Phone 7.1 application. I have a UserControl which has

  • 0

I am working on Windows Phone 7.1 application.
I have a UserControl which has a bunch Silverlight child controls. The font sizes for most of these child controls can be same as that of the host of the said UserControl (which will anyway get inherited from the host).

However for one of the child controls, I want to set the FontSize to half the FontSize of the UserControl. And I want it to update if the FontSize of the host changes.
But now during the UserControl design time, since there is no host, I am unable make this work. Doing something like 0.5*FontSize results in some default value of FontSize and it does not get updated when the FontSize changes.

What should I be doing to make it work?

  • 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-26T17:06:44+00:00Added an answer on May 26, 2026 at 5:06 pm

    You can bind your FontSize property to the FontSize property of your UserControl and use a converter to do the ratio.

    Here’s a sample with a textblock inside a page:

    <TextBlock FontSize="{Binding ElementName=MyPage, Path=FontSize, 
     Converter={StaticResource FontSizeConverter}}" 
     Text="any text" />
    

    And the converter (declared as a resource in the App.xaml file:

    public class FontSizeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var valueToConvert = value == null ? 0 : System.Convert.ToDouble(value);
    
            return valueToConvert * 0.5;
        }
    
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException("no use");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a windows phone 7 application which uses Silverlight. What I'm looking
I have been working fine with MVVM Light on a silverlight 4 Windows Phone
I'm working at Windows Phone application these days and have faced the problem with
I have been working on Windows Phone 7 application & was trying to make
I am working on a Silverlight based Windows Phone application that only supports landscape
I am working on an application for windows phone 7. I have a to
I am working on a xmpp chat application for windows phone 7. It receives
I'm working on a windows phone project where I have some xml files with
I'm working on a Windows Phone application that displays an audioStream (as radio) but
I am working on an application in windows phone 7.And I want to whether

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.