Jump to content

 

Photo

Pointer of Gaugespointer pointer


  • Please log in to reply
5 replies to this topic

#1 starrycheng

starrycheng

    Advanced Member

  • Members
  • PipPipPip
  • 84 posts
  • Gender:Male
  • Location:Shanghai, China

Posted 07 April 2012 - 01:37 PM

"Z-Index " attribute of the instrument pointer. Problem as shown in the below picture.
Attached File  指针.png   42.44K   2 downloads

Question :
How to make "Textbox" is located above the dial , and then pointer is located in the "Textbox" above ?


XAML:
<Grid x:Name="LayoutRoot" Background="White">
<my:Gauge >
<my:Gauge.Indicators>
<my:NeedleIndicator Name="BI_Value" Value="5"></my:NeedleIndicator>
</my:Gauge.Indicators>
</my:Gauge>
<TextBox Height="23" HorizontalAlignment="Left" Margin="100,146,0,0" Name="textBox1" VerticalAlignment="Top" Width="88" Foreground="#FFD7D9DC" Background="#FF3E4049" Text="读数为:5 kWh" />
</Grid>

Thanks a lot...



I like Visifire ,like silverlight...

#2 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,605 posts
  • Gender:Male
  • Location:Bangalore

Posted 09 April 2012 - 04:52 AM

Starrycheng,

Why are you using your own TextBox here? You can make use of Indicator label. Please try setting LabelEnabled property to True in NeedleIndicator. You can customize the label by setting its text and color using LabelText and LabelFontColor properties.

If still you want to use your own TextBox, I would suggest you to edit the Gauge template and place the TextBox inside it. For more info, please check documentation below.
http://www.visifire....g_Templates.htm

Regards,
Vivek
Team Visifire


#3 starrycheng

starrycheng

    Advanced Member

  • Members
  • PipPipPip
  • 84 posts
  • Gender:Male
  • Location:Shanghai, China

Posted 09 April 2012 - 02:10 PM

Starrycheng,

Why are you using your own TextBox here? You can make use of Indicator label. Please try setting LabelEnabled property to True in NeedleIndicator. You can customize the label by setting its text and color using LabelText and LabelFontColor properties.

If still you want to use your own TextBox, I would suggest you to edit the Gauge template and place the TextBox inside it. For more info, please check documentation below.
http://www.visifire....g_Templates.htm


In this way does not work ? Why???



<Canvas>
<Canvas.Resources>
<Style x:Key="BarStyle" TargetType="my:NeedleIndicator">
<Setter Property="Canvas.ZIndex" Value="2"></Setter>
</Style>
</Canvas.Resources>
<my:Gauge Name="SLGauges" Height="242" Width="290">
<my:Gauge.Indicators>
<my:NeedleIndicator Name="BI_Value" Style="{StaticResource BarStyle}" ></my:NeedleIndicator>
</my:Gauge.Indicators>
<my:Gauge.CircularScales>
<my:CircularScale Minimum="0" Maximum="10000" >

</my:CircularScale>
</my:Gauge.CircularScales>
</my:Gauge>
</Canvas>

Thanks a lot...



I like Visifire ,like silverlight...

#4 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,605 posts
  • Gender:Male
  • Location:Bangalore

Posted 10 April 2012 - 04:33 AM

TextBox is a different element altogether which is outside the Gauge. Gauge consists of lot of elements like Circular scale, Indicators etc. So setting ZIndex in Indicator won't work since TextBox is outside the Gauge. You can try enabling Indicator label as I have mentioned in my last reply.

Regards,
Vivek
Team Visifire


#5 starrycheng

starrycheng

    Advanced Member

  • Members
  • PipPipPip
  • 84 posts
  • Gender:Male
  • Location:Shanghai, China

Posted 10 April 2012 - 05:02 AM

TextBox is a different element altogether which is outside the Gauge. Gauge consists of lot of elements like Circular scale, Indicators etc. So setting ZIndex in Indicator won't work since TextBox is outside the Gauge. You can try enabling Indicator label as I have mentioned in my last reply.


Thank you very much...

The xaml:


<Grid x:Name="LayoutRoot" Background="White">
<Canvas>
<Canvas.Resources>
<Style x:Key="BarStyle" TargetType="my:NeedleIndicator">
<Setter Property="Canvas.ZIndex" Value="2"></Setter>
</Style>
</Canvas.Resources>
<my:Gauge Name="SLGauges" Height="242" Width="290">
<my:Gauge.Indicators>
<my:NeedleIndicator Name="BI_Value" Style="{StaticResource BarStyle}" ></my:NeedleIndicator>
</my:Gauge.Indicators>
<my:Gauge.CircularScales>
<my:CircularScale Minimum="0" Maximum="10000" >

</my:CircularScale>
</my:Gauge.CircularScales>
</my:Gauge>
</Canvas>
<TextBox Height="23" HorizontalAlignment="Left" Margin="101,144,0,0" Name="tb_Value" VerticalAlignment="Top" Width="88" Foreground="#FFD7D9DC" Background="#FF3E4049" Text="" />
</Grid>



Question:

Now is to "my: NeedleIndicator" elements (BI_Value) , showed that in the "TextBox" (tb_Value) above.
Is the TextBox (tb_Value) on the Canvas element inside it ?


I like Visifire ,like silverlight...

#6 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,605 posts
  • Gender:Male
  • Location:Bangalore

Posted 10 April 2012 - 05:11 AM

I didn't get it properly. Can you please elaborate it.

Regards,
Vivek
Team Visifire





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users