Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
ItemControl and XamWebGauge
posted

Hello,

Is - it possible to use XamWebGauge in a ItemControl and "Binding" EndValue and StartValue ?

Presently, i got an error.

Thanks.

Parents
  • 28496
    Verified Answer
    Offline posted

    yes, it is possible.  here's some code to get you started.

            <ListBox Height="300" Width="300" Background="Pink" >
                <ListBox.ItemsSource>
                    <local:MyData />
                </ListBox.ItemsSource>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <igGauge:XamWebRadialGauge Height="100" Width="100">
                            <igGauge:XamWebRadialGauge.Scales>
                                <igGauge:RadialGaugeScale StartValue="{Binding StartValue}" EndValue="{Binding EndValue}">
                                    <igGauge:RadialGaugeScale.LabelGroups>
                                        <igGauge:RadialGaugeLabelGroup />
                                    </igGauge:RadialGaugeScale.LabelGroups>
                                </igGauge:RadialGaugeScale>
                            </igGauge:XamWebRadialGauge.Scales>
                        </igGauge:XamWebRadialGauge>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

        public class Widget
        {
            public double StartValue { get; set; }
            public double EndValue { get; set; }
        }
        public class MyData : ObservableCollection<Widget>
        {
            public MyData() : base()
            {
                this.Add(new Widget() { StartValue = 1, EndValue = 2 });
                this.Add(new Widget() { StartValue = 3, EndValue = 4 });
                this.Add(new Widget() { StartValue = 5, EndValue = 6 });
            }
        }

Reply Children