binding time from api in Sfdigitalgauge

hi,same as tilte can't binding time from api in SFdigitalgauge 

my snippet

 <StackLayout>




        <gauge:SfDigitalGauge Value="{Binding datetime}" SegmentStrokeWidth="5" BackgroundColor="White"

                               HeightRequest="100" WidthRequest="375"

                               DisabledSegmentAlpha="25" DisabledSegmentColor="Gray"

                               CharacterHeight="90" CharacterWidth="25"

                               HorizontalOptions="Center" VerticalOptions="Center"

                               CharacterType="EightCrossEightDotMatrix"

                               CharacterStrokeColor="#146CED"/>

    </StackLayout>

model


class Time

    {

    }

    public class Rootpos

    {

        public string datetime { get; set; }

        public string timezone_name { get; set; }

        public string timezone_location { get; set; }

        public string timezone_abbreviation { get; set; }

        public int gmt_offset { get; set; }

        public bool is_dst { get; set; }

        public string requested_location { get; set; }

        public double latitude { get; set; }

        public double longitude { get; set; }

    }


 private async void Button_Clicked1(object sender, EventArgs e)

        {

            await Navigation.PushAsync(new Page1());

            var request1 = new HttpRequestMessage();

            request1.RequestUri = new Uri("https://timezone.abstractapi.com/v1/current_time/?api_key=token&location=Oxford, United Kingdom");

            request1.Method = HttpMethod.Get;

            request1.Headers.Add("Accept", "application/json");

            request1.Headers.Add("x-api-key", "token");

            var client1 = new HttpClient();

            HttpResponseMessage response1 = await client1.SendAsync(request1);

            string content1 = await response1.Content.ReadAsStringAsync();

            Rootpos dataObjects1 = JsonConvert.DeserializeObject<Rootpos>(content1);

            Console.WriteLine(dataObjects1.ToString());


        }


thanks


1 Reply

ET Eswaran Thirugnanasambandam Syncfusion Team April 19, 2022 02:42 PM UTC

We checked the reported problem “Value property binding not working” and we are unable to replicate the issue from our side. We have changed your code based on your scenario to bind the value property to show the time. Please get the tested sample from the below attachment. 


Please check the sample. If you still face any problem, can you revert us by modifying the sample based on your scenario, this will help us to provide you a better solution at the earliest.


Attachment: DigitalGauge_48414107.zip

Loader.
Up arrow icon