This question is locked. New answers and comments are not allowed.
Hello,
I can't seem to get this to work.
The two items are in the same Grid. I omitted the rest of the Gauges code for brevity's sake. The gauge appears just fine. I am not sure what is causing the binding issue. I know that the DataContext of MFMarker is what I want it to be. Shouldn't the DataContext of the TextBlock inside the DataTemplate be the same? I would greatly appreciate any help anyone can give. Thank you.
I can't seem to get this to work.
<!-- this binding works just fine -->
<
TextBlock
Text
=
"{Binding MFPercent}"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Top"
/>
<!-- but this binding does not work AT ALL -->
<
gauges:MarkerGaugeIndicator
x:Name
=
"MFMarker"
Value
=
"66"
>
<
gauges:MarkerGaugeIndicator.MarkerTemplate
>
<
DataTemplate
>
<
Grid
Width
=
"50"
>
<
TextBlock
x:Name
=
"MFP"
FontSize
=
"16"
Text
=
"{Binding MFPercent}"
/>
</
Grid
>
</
DataTemplate
>
</
gauges:MarkerGaugeIndicator.MarkerTemplate
>
</
gauges:MarkerGaugeIndicator
>
The two items are in the same Grid. I omitted the rest of the Gauges code for brevity's sake. The gauge appears just fine. I am not sure what is causing the binding issue. I know that the DataContext of MFMarker is what I want it to be. Shouldn't the DataContext of the TextBlock inside the DataTemplate be the same? I would greatly appreciate any help anyone can give. Thank you.