<p>I'm getting all learned up about binding in WPF.  I'm having a lot of trouble debugging the parse errors in my xaml, though.  Can somebody pretty please tell me what's wrong with this little piece? :</p>

<pre><code>&lt;Border Name="TrackBackground"
    Margin="0"
    CornerRadius="2"                     
    Grid.Row="1"
    Grid.Column="1"
    Background="BlanchedAlmond"
    BorderThickness="1"
    Height="{TemplateBinding Height}"&gt;

    &lt;Canvas Name="PART_Track" Background="DarkSalmon" Grid.Row="1" Grid.Column="1"&gt;
        &lt;Thumb Name="ThumbKnob" Height="{Binding ElementName=Part_Track, Path=Height, Mode=OneWay}" /&gt;
    &lt;/Canvas&gt;
&lt;/Border&gt;
</code></pre>

<p>It's the databinding that breaks.  I get an <code>InvalidAttributeValue</code> exception for ThumbKnob.Height when I try to run this.  I know I must be missing something fundamental.  So fill me in, stackers, and my gratitude will be boundless.</p>

<hr>

<p>Changing the ElementName didn't help.  There must me something else I'm not getting.</p>

<p>I should mention that I'm testing this in Silverlight.  The exact message I'm getting out of Internet Explorer is:</p>

<p><code>XamlParseException: Invalid attribute value for property Height.</code></p>

<p>This whole thing is inside a ControlTemplate.  I'm making a slider control just to teach myself the concepts.</p>

[{'answer_id': 7776, 'author': 'Arcturus', 'author_id': 900, 'author_profile': 'https://Stackoverflow.com/users/900', 'pm_score': 0, 'selected': False, 'text': '<p>First of all its a matter of casing...</p>\n\n<p>Change <pre><code>Part_Track</code></pre> to <pre><code>PART_Track</code></pre> which will fix your binding error..</p>\n\n<p>But I do not think that this is what you are trying to do..</p>\n\n<p>You could use a Grid instead of a canvas, and the Thumb will size automatically. Canvas does not really have a height, for it does not really care about the height of its children...</p>\n\n<p>Hope this helps...</p>\n'}, {'answer_id': 7789, 'author': 'Arcturus', 'author_id': 900, 'author_profile': 'https://Stackoverflow.com/users/900', 'pm_score': 0, 'selected': False, 'text': '<p>Is the Border in a Template btw ?</p>\n\n<p>Because there is no need for TemplateBinding if the border is not located in a Template (either ControlTemplate or DataTemplate)</p>\n'}, {'answer_id': 7801, 'author': 'Arcturus', 'author_id': 900, 'author_profile': 'https://Stackoverflow.com/users/900', 'pm_score': 1, 'selected': False, 'text': "<p>What I usually do to debug databindings, is add a converter where I can set a breakpoint in VS.NET..</p>\n\n<p>so the Binding would be something like this:</p>\n\n<pre><code>{Binding ElementName=PART_Track, Path=Height, Mode=OneWay, Converter={StaticResources DebugConverter}}\n</code></pre>\n\n<p>Then the converter can be an empty implementation of an IValueConverter, set a breakpoint in the Convert method and see what the Height is being set to...</p>\n\n<p>Don't forget to add your converter to your Resources...</p>\n\n<p>Perhaps the value is NaN ?</p>\n"}, {'answer_id': 7844, 'author': 'Arcturus', 'author_id': 900, 'author_profile': 'https://Stackoverflow.com/users/900', 'pm_score': 1, 'selected': False, 'text': '<p>Hmm there might be a substantial difference between WPF en Silverlight on this point..</p>\n\n<p>I seem to have no trouble what so even compiling and running this sample in a WPF window: </p>\n\n<pre><code>&lt;Slider Width="400" Height="20"&gt;\n    &lt;Slider.Template&gt;\n        &lt;ControlTemplate&gt;\n            &lt;Border Name="TrackBackground"\n                Margin="0"\n                CornerRadius="2"                     \n                Grid.Row="1"\n                Grid.Column="1"\n                Background="BlanchedAlmond"\n                BorderThickness="1"&gt;\n\n                &lt;Canvas x:Name="PART_Track" Background="DarkSalmon" Grid.Row="1" Grid.Column="1"&gt;\n                    &lt;Thumb Name="ThumbKnob" Height="{Binding ElementName=PART_Track, Path=Height, Mode=OneWay}" /&gt;\n                &lt;/Canvas&gt;\n            &lt;/Border&gt;\n        &lt;/ControlTemplate&gt;\n    &lt;/Slider.Template&gt;\n&lt;/Slider&gt;\n</code></pre>\n\n<p>Perhaps Silverlight has fewer properties in the Thumb class...</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.thumb.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.thumb.aspx</a></p>\n'}, {'answer_id': 8461, 'author': 'Brian Leahy', 'author_id': 580, 'author_profile': 'https://Stackoverflow.com/users/580', 'pm_score': 3, 'selected': True, 'text': "<p>The ElementName property on a Binding is not supported in Silverlight.</p>\n\n<p>You will notice, if you go into the code behind or inspect the Binding object in class explorer, it doesn't have a property named ElementName.</p>\n"}, {'answer_id': 8713, 'author': 'MojoFilter', 'author_id': 93, 'author_profile': 'https://Stackoverflow.com/users/93', 'pm_score': 1, 'selected': False, 'text': "<p>Ok, here's the deal:</p>\n\n<p>In silverlight, you can't bind values from one UI element to another declaratively.  The only way to do what I was trying to do here would be in the C# code.</p>\n\n<p>I had a reference for this yesterday, but now I guess you'll just have to take my word for it :)</p>\n"}, {'answer_id': 2285007, 'author': 'Jason Roberts', 'author_id': 273822, 'author_profile': 'https://Stackoverflow.com/users/273822', 'pm_score': 0, 'selected': False, 'text': '<p>Silverlight 3 now includes ElementName binding...</p>\n'}]
['https://Stackoverflow.com/questions/7758', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/93/']