We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

WinRT SfCircularGauge does nothing ...

Thread ID:

Created:

Updated:

Platform:

Replies:

107511 Mar 5,2013 02:51 PM UTC Jun 17,2014 12:45 PM UTC WPF 14
loading
Tags: Gauge
Martin
Asked On March 5, 2013 02:51 PM UTC


... even though the value i am binding to changes. What am i missing here?

this is the xaml of the needlepointer that i want to see moving. Is there a problem with the binding here? The value i am binding to is a double.

<syncfusion:CircularPointer PointerType="RangePointer" Value="{Binding MyViewModel.GaugeValue, Mode=TwoWay}" NeedlePointerStroke="{StaticResource MyBrushes_Foreground}" />

greetings


Joy Oyiess Rex  K [Syncfusion]
Replied On March 7, 2013 05:07 AM UTC

Hi Martin,

Thanks for using Syncfusion Products.

As per the implementation, the CircularPointer in the CircularScale is of type DependencyObject. So it does not have any DataContext from its parent. Therefore while bind the value for the CircularPointer it does not have any DataContext as its Source.

Therefore we can achieve this scenario through the following Code Snippet:

·         Set the Resource

<Page.Resources>

    <local1:MyViewModel x:Key="dataSource" />

</Page.Resources>

 

·         Bind the Value Property by set the Resource key as a Source

 

<syncfusion:CircularScale.Pointers>

   <syncfusion:CircularPointer  PointerType="NeedlePointer" Value="{Binding Source={StaticResource dataSource}, Path=Value}"  />

</syncfusion:CircularScale.Pointers>

 

 

·         Inorder to Move the NeedlePointer we can bind it with a slider with the same object as a source to move the pointer dynamically.

·         Set the DataContext for the parent grid of the Slider.

      <Grid DataContext="{Binding Source={StaticResource dataSource}}"  >

 

     <Slider Value="{Binding Value,Mode=TwoWay}" Minimum="0" Maximum="100" />

 

Note : In your Code Snippet you have mentioned that the PointerType property is Set as RangePointer and you have used used NeedlePointerStroke Property in it. Instead of that you can use RangePointerStroke property to apply stroke for the pointer.

We have also attached a sample for the same.

 

Regards,

Joy Oyiess Rex.K



CircularGaugeNeedleBindSample_dc492c70.zip

Martin
Replied On March 8, 2013 12:06 PM UTC

Thanks for your reply!

Unfortunately MyViewModel is Singleton-class with only one instance in my case.

So i cant't use the code:
<Page.Resources>
    <local1:MyViewModel x:Key="dataSource" />
</
Page.Resources>

.. because that would be the same is MyViewModel test1 = new MyViewModel (), which is not possible due to the inaccessible constructor of my singleton class.

So basically i would like to bind the needle-value to a property of a singleton-class. Is this possible?



Note: When i want to bind to another element (e.g. a textblock) i do it like this:

Code behind:
this.DefaultViewModel["Blabla"] = MyViewModel.Instance;

Xaml:
<TextBlock Text="{Binding Blabla.GaugeValue}" />


Greetings from austria! :)



Baskaran S [Syncfusion]
Replied On March 11, 2013 01:30 PM UTC

Hi Martin,

Thanks for your update.

As you have mentioned we have created a Singleton class for changing the value of the CircularGauge pointer. For your reference we have attached the sample below.

Please try the sample and let us know if this helps you. Please let us know if you require further clarifications.

Regards,

Baskaran S

 



CircularGaugeNeedleBindSample_3aa6a916.zip

Martin
Replied On March 12, 2013 12:06 PM UTC


Works like a charm! Thanks a lot for your help!

Joy Oyiess Rex  K [Syncfusion]
Replied On March 13, 2013 05:59 AM UTC

Hi Martin,

Thanks for your feedback.

Please let us know, if you have any further assistance.

Regards,

Joy Oyiess Rex.K


Cesar Calvo Cobo
Replied On July 30, 2013 10:56 AM UTC

Hi, I have got the same problem . 
Trying to set dynamically the value of the circular pointer binding with local resources  , with no luck. 
I can not access the element name in code behind because is inside a tabcontrol 

Any workaround? 

I am using last version of winrt controls: 11.2.0.29

Thanks in advance 




Resources   
 <local:DataSourceCompetencias x:Key="DatosCompetencias"/>

Binding

                                                    <Gauges:CircularPointer x:Name="valorcompetencia" EnableAnimation="False" PointerCapDiameter="20" PointerType="NeedlePointer" NeedlePointerStroke="#39b2c6" NeedlePointerStrokeThickness="3" NeedleLengthFactor="0.6" PointerCapStroke="#414d4f"   Value="{Binding Source={StaticResource DatosCompetencias}, Path=Media}"  />


Model: 
public class DataSourceCompetencias
    {
        public ObservableCollection<Competencia> ListaCompetencias { get; set; }

        public DataSourceCompetencias()
        {
            Initialize();
        }

        public void Initialize()
        {
            ListaCompetencias = new ObservableCollection<Competencia>();
            ListaCompetencias.Add(new Competencia("Nombre1", 3));
            ListaCompetencias.Add(new Competencia("Nombre2", 4));
            ListaCompetencias.Add(new Competencia("Nombre3", 2));
        }

public class Competencia
    {
         public Competencia(string nombre, int media)
        {
            Media = media;
            Nombre = nombre;
        }
        public int UserID { get; set; }

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int CompetenciaID { get; set; }

        public string Nombre { get; set; }
        public string F1 { get; set; }
        public int PUNTF1 { get; set; }
        public string F2 { get; set; }
        public int PUNTF2 { get; set; }
        public string F3 { get; set; }
        public int PUNTF3 { get; set; }
        public int Media { get; set; }
         


    }
    
       




Cesar Calvo Cobo
Replied On July 30, 2013 11:16 AM UTC

Update : I am solving it temporarily creating collapsed control out of circularpointer , binding the datasource to this control and binding the circular pointer to this element . 
Not the best solution, of course . 




Joy Oyiess Rex  K [Syncfusion]
Replied On July 31, 2013 07:22 AM UTC

Hi Cesar,

 

Thank you for using Syncfusion Products.

 

Based on your requirement we have created a simple sample to dynamically update the Value of the CircularPointer (in the tab control). Please find the sample in the attachment.

If the provided solution doesn't meet your requirement, Please revert us back with more information by thus we could assist you better.

 

Please  let us know, if you need any further assistance.

 

Best Regards,

Joy Oyiess Rex K



CircularGaugeNeedleBindSample_378f557a.zip

Cesar Calvo Cobo
Replied On July 31, 2013 09:51 AM UTC

Great sample and support! Thank you . 

Joy Oyiess Rex  K [Syncfusion]
Replied On August 1, 2013 04:37 AM UTC

Hi Cesar,

Thanks for your feedback.

Please let us know, if you need any further assistance.

Beat Regards,
Joy Oyiess Rex.K

Nick Woessner
Replied On October 2, 2013 05:27 PM UTC

I am having the same issue as Martin was, except in WPF. Can I get a copy of the sample you provided him.

 

Thanks


Joy Oyiess Rex  K [Syncfusion]
Replied On October 4, 2013 04:38 AM UTC

Hi Nick,

 

Thanks for your interest in Syncfusion Products.

 

We have attached the samples in the attachment below,

 

Please let us know, if you need any further assistance.

 

Regards,

Joy Oyiess Rex K



CircularGaugeNeedleBindSample_2eebd2d1.zip

Daniel Thompson
Replied On June 16, 2014 08:17 PM UTC

Hi,

Whenever I try to download these samples, I get a blob of xml that says "not authorized". Can you enable them for download please?

Nijamudeen Mohamed Sulaiman [Syncfusion]
Replied On June 17, 2014 12:45 PM UTC

Hi Daniel,

 

Thanks for your interest in Syncfusion Products.

 

Due to some server issue we are unable to retrieve these samples. As of now we have prepared a sample related to this query. Please find the sample in the attachment.

 

Please let us know, if you need any further assistance.

 

Regards,

Nijamudeen M.


Attachment: CircularGaugeNeedleBindSample_a463df83.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;