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

  • Home
  • SEARCH
  • 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 7012123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:12:54+00:00 2026-05-27T22:12:54+00:00

I have created a lookless control using silverlight 4. This control contains a textbox

  • 0

I have created a lookless control using silverlight 4. This control contains a textbox which the user will type data into and a button that increases the size of the textbox by increasing the MinHeight of the control by 10 each time it is pressed (I have set the textbox to stretch so it grows with the control).

This bit works fine but I now want to extend the controls functionality by adding another textbox that will display the current MinHeight of the control which I dont seem to be able to do. I have been trying

Text="{Binding RelativeSource={RelativeSource Self}, Path=MinHeight, Mode=TwoWay}">

Im not sure why but this always shows as 0

Update

In my attempts to resolve I tried chaging the name of the source textbox to PART_sourceData and just to see if the binding was correct I set the path to the text property. This appears to bring through the text of the sourcedata as I would expect

Text="{Binding Mode=TwoWay, ElementName=PART_sourceData, Path=Text}"

My next step was to change the path to Height

Text="{Binding Mode=TwoWay, ElementName=PART_sourceData, Path=Height}"

But this returns NaN. Therefore I tried MinHeight

Text="{Binding Mode=TwoWay, ElementName=PART_sourceData, Path=MinHeight}"

This always returns 0 even though the code behind has a valid number. Whats going wrong? Becuase the text comes through properly I beleive the binding to be correct but whats wrong with getting the height?

  • 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-27T22:12:54+00:00Added an answer on May 27, 2026 at 10:12 pm

    Ok I have a solution. Not the best but it works!

    I have had to create a new dependancy property

    public static readonly DependencyProperty EditorHeightProperty =
            DependencyProperty.Register("EditorHeight", typeof(string), typeof(EditorControl), new PropertyMetadata(default(string)));
    
        public string EditorHeight
        {
            get { return (string)GetValue(EditorHeightProperty); }
            set { SetValue(EditorHeightProperty, value); }
        }
    

    Then I bind the text to this property using

    Text="{TemplateBinding EditorHeight}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a user defined type to contain some data that I will
I have created a keyboard using asp:button control. Onclientclick event it will display the
I have created a Silverlight project which also contains a Web project. I have
I have created form using ModelForm but its not saving data into database. views.py
I have created a windows service which is set to start automatically. This service
i have created a running process which listens for input: listen = Popen([home/user/listen], stdout=PIPE,
I have create a lookless control to be used in a Silverlight 4 project.
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a C# class file by using a XSD-file as an input.
I have created a SharePoint workflow in visual studio , I have extended this

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.