Posted 14 years ago
by 7Alpha7

Hi,
sorry for this stupid question but I am a neewbie on WPF and I cannot figure out how to set the X and Y dependency properties of an embedded TextBloc in a Gauge.
For example if I have something like :How can I set the TextBlock DigitalGauge.X and DigitalGauge.Y properties in the code behind ?
I tried something likebut it said that gauge.X is not a dependency property, and something static like DigitalGauge.X does not exists...
Thank you.
[Modified at 01/16/2011 11:59 AM]
sorry for this stupid question but I am a neewbie on WPF and I cannot figure out how to set the X and Y dependency properties of an embedded TextBloc in a Gauge.
For example if I have something like :
<gauge:DigitalGauge x:Name="gauge" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Value="200"
CharacterCount="10" Foreground="Cyan" Background="Black" CharacterPadding="10,0" BackgroundType="RoundedRectangleLightGradient"
RimType="RoundedRectangleLightGradient" CharacterType="DotMatrix5By7Rectangle">
<gauge:DigitalGauge.Items>
<TextBlock x:Name="textBlock" gauge:DigitalGauge.X="0" gauge:DigitalGauge.Y="0" Text="Hello"
FontFamily="Courier New" Foreground="WhiteSmoke" FontSize="20" />
</gauge:DigitalGauge.Items>
</gauge:DigitalGauge>
I tried something like
textBlock.GetValue(gauge.X)
Thank you.
[Modified at 01/16/2011 11:59 AM]