This project is read-only.
1

Resolved

Goalmarkers Problem

description

It throws an exception in the GoalMarkers_CollectionChanged event:

//Code behind in wpfgauge.xaml.cs
private void GoalMarkers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
    {
        if(e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
            foreach (GoalMarker gm in e.NewItems)
            {
                gm.ParentGauge = this;
                gm.GaugeMax = this.MaxValue;
                gm.GaugeStartAngle = this.StartAngle;
                gm.GaugeEndAngle = this.EndAngle;

                //GoalMarker gm2 = new GoalMarker();
                //gm2.ParentGauge = gm.ParentGauge;
                //gm2.GaugeMax = gm.GaugeMax;
                //gm2.GaugeStartAngle = gm.GaugeStartAngle;
                //gm2.GaugeEndAngle = gm.GaugeEndAngle;

                GoalMarkerLayout.Children.Add(gm);
            }
    } 

<!--XAML--> <gg:Gauge Grid.Column="1"
                    FontSize="12" AutoScale="False" Value="1250"
                    x:Name="TGauge" MajorTickCount="10" MinorTickCount="5" MinValue="0" MaxValue="5000" 
                    HorizontalAlignment="Left"  StartAngle="-65" EndAngle="247" MajorTickMarkColor="LightYellow" Margin="0" Grid.Row="1" VerticalAlignment="Top" Height="200" Width="200">
                            <gg:Gauge.GoalMarkers>
                                <gg:GoalMarker MarkerColor="Red" Value="2000"></gg:GoalMarker>
                            </gg:Gauge.GoalMarkers>
                            <gg:Gauge.ValueTextStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="Foreground" Value="White"/>
                            <Setter Property="Margin" Value="0,60,0,0" />
                            <Setter Property="FontSize" Value="12"/>
                        </Style>
                    </gg:Gauge.ValueTextStyle>

                    <gg:Gauge.TickLabelStyle>
                        <Style TargetType="TextBlock">
                            <Setter Property="Foreground" Value="White"/>
                            <Setter Property="FontSize" Value="12"/>
                        </Style>
                    </gg:Gauge.TickLabelStyle>

                </gg:Gauge>
                    </StackPanel>
                    <StackPanel>
                        <gg:Gauge Grid.Column="1"
                    FontSize="12" AutoScale="False" Value="150"
                    StartAngle="-65" EndAngle="247" MajorTickMarkColor="LightYellow"  x:Name="TGauge2" MajorTickCount="10" MinorTickCount="5" MinValue="0" MaxValue="500" 
                    HorizontalAlignment="Left"  Margin="0" Grid.Row="1" VerticalAlignment="Top" Height="200" Width="200">
                            <gg:Gauge.GoalMarkers>
                                <gg:GoalMarker MarkerColor="Red" Value="200"></gg:GoalMarker>
                            </gg:Gauge.GoalMarkers>
                            <gg:Gauge.ValueTextStyle>
                                <Style TargetType="TextBlock">
                                    <Setter Property="Margin" Value="0,50,0,0"></Setter>
                                    <Setter Property="Foreground" Value="#fff" />
                                    <Setter Property="FontSize" Value="15" />
                                    <Setter Property="FontWeight" Value="Bold" />
                                    <Setter Property="FontFamily" Value="Tahoma" />
                                </Style>
                            </gg:Gauge.ValueTextStyle>

                            <gg:Gauge.TickLabelStyle>
                                <Style TargetType="TextBlock">
                                    <Setter Property="Foreground" Value="White"/>
                                    <Setter Property="FontSize" Value="12"/>
                                </Style>
                            </gg:Gauge.TickLabelStyle>

                        </gg:Gauge>

comments

wrote Apr 23, 2014 at 4:00 AM

Resolved with changeset 33505: Stable. Fixed Issue 1392 - Goalmarkers Problem.

tjscience wrote Apr 23, 2014 at 4:01 AM

** Closed by tjscience 4/22/2014 8:00 PM

wrote Apr 23, 2014 at 4:01 AM

wrote Apr 23, 2014 at 4:01 AM

wrote Dec 1 at 5:17 AM