Posted 16 years ago
by Ravindra
-
Sr. Software Engineer,
Persistent Systems Ltd
Version: 4.5.0471
Platform: .NET 3.5
Environment: Windows XP (32-bit)

Hello,
i am evaluating gauge controls for the our project. when i used it in control template, it giving me the design times error. i am binding the values from the code behind dependency properties.
Error message :
Layout measurement override of element 'ActiproSoftware.Windows.Controls.Gauge.CircularScale' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size.
I am not able get the problem with this. please look at the xaml also.
<UserControl x:Class="Moog.FCS.FTS.Client.SmartClient.Controls.Meters.Gauge"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:gauge="http://schemas.actiprosoftware.com/winfx/xaml/gauge"
Height="200" Width="202" >
<UserControl.Resources>
<shared:StringFormatConverter x:Key="StringFormatConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ControlTemplate x:Key="gaugeHalfTachometer" TargetType="{ x:Type Control }">
<gauge:CircularGauge x:Name="gaugeFrame" FrameType="SemicircularRoundedRectangle" Radius="99" Background="#444444"
RimBrush="#444444" Margin="0,0,0,0">
<gauge:CircularGauge.Items>
<gauge:DigitalGauge gauge:CircularGauge.X="0" gauge:CircularGauge.Y="-30"
Width="80" Height="25"
Background="{Binding ElementName =gaugeFrame, Path = Background}"
RimBrush="{Binding ElementName =gaugeFrame, Path = RimBrush}"
CharacterType="Segment7Trapezoid" CharacterCount="7" CharacterSpacing="2"
Foreground="White" CharacterHeight="10"
Value="{Binding ElementName=needle, Path=Value,
Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:###.###0}'}" OpacityMask="Sienna" />
<TextBlock x:Name="txtTitle" gauge:CircularGauge.X="0" gauge:CircularGauge.Y="14" Text="{ Binding Path = Title}" Foreground="WhiteSmoke"
FontSize="6" />
<TextBlock x:Name="txtUnit" gauge:CircularGauge.X="37" gauge:CircularGauge.Y="60" Text="{ Binding Path = Unit}" Foreground="WhiteSmoke"
FontSize="6" />
</gauge:CircularGauge.Items>
<gauge:CircularGauge.Scales>
<gauge:CircularScale Radius="85" StartAngle="180" SweepAngle="180" BarExtent="2" IsBarVisible="False"
Background="{shared:LinearGradientBrush Gray, DarkGray, GradientType=TopToBottom}">
<gauge:CircularScale.TickSets>
<gauge:CircularTickSet Minimum="{Binding Path = Minimum }" Maximum="{Binding Path = Maximum }"
MajorInterval="{Binding Path = MajorInterval }"
MinorInterval="{Binding Path = MinorInterval }">
<gauge:CircularTickSet.Ticks>
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="White" ScalePlacement="Inside" EndValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor x:Name="scaleSafeMajorRange" TickMarkExtent="6" TickMarkAscent="1" Background="White"
ScalePlacement="Inside" EndValue="6.5" />
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor TickMarkExtent="6" TickMarkAscent="1"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickLabelMajor FontFamily="Verdana" FontSize="8" Foreground="White"
TextOrientation="Rotated" ScalePlacement="Inside" ScaleOffset="7"
/>
</gauge:CircularTickSet.Ticks>
<gauge:CircularTickSet.Pointers>
<gauge:CircularPointerNeedle x:Name="needle" Value="{Binding Path = Value }"
Background="{shared:LinearGradientBrush #DB0707, #FF0404, GradientType=TopToBottom}"
PointerExtent="100%" PointerAscent="3%" />
<gauge:CircularPointerCap CapType="CircleConvex"
Background="{shared:LinearGradientBrush #751515, #990E0E, GradientType=TopToBottom}"
PointerExtent="25%" />
</gauge:CircularTickSet.Pointers>
</gauge:CircularTickSet>
</gauge:CircularScale.TickSets>
</gauge:CircularScale>
</gauge:CircularGauge.Scales>
</gauge:CircularGauge>
</ControlTemplate>
<ControlTemplate x:Key="gaugeTachometer" TargetType="{x:Type Control}">
<gauge:CircularGauge x:Name="gaugeFrame" FrameType="CircularTopGradient" Radius="99" Background="#444444"
RimBrush="#444444" Margin="0,0,0,0">
<gauge:CircularGauge.Items>
<gauge:DigitalGauge gauge:CircularGauge.X="0" gauge:CircularGauge.Y="-30"
Width="80" Height="25"
Background="{Binding ElementName =gaugeFrame, Path = Background}"
RimBrush="{Binding ElementName =gaugeFrame, Path = RimBrush}"
CharacterType="Segment7Trapezoid" CharacterCount="7" CharacterSpacing="2"
Foreground="White" CharacterHeight="10"
Value="{Binding ElementName=needle, Path=Value,
Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:###.###0}'}" OpacityMask="Sienna" />
<TextBlock x:Name="txtTitle" gauge:CircularGauge.X="0" gauge:CircularGauge.Y="14" Text="{ Binding Path = Title}" Foreground="WhiteSmoke"
FontSize="6" />
<TextBlock x:Name="txtUnit" gauge:CircularGauge.X="37" gauge:CircularGauge.Y="60" Text="{ Binding Path = Unit}" Foreground="WhiteSmoke"
FontSize="6" />
</gauge:CircularGauge.Items>
<gauge:CircularGauge.Scales>
<gauge:CircularScale Radius="85" StartAngle="135" SweepAngle="270" BarExtent="2" IsBarVisible="False"
Background="{shared:LinearGradientBrush Gray, DarkGray, GradientType=TopToBottom}">
<gauge:CircularScale.TickSets>
<gauge:CircularTickSet Minimum="{Binding Path = Minimum }" Maximum="{Binding Path = Maximum }"
MajorInterval="{Binding Path = MajorInterval }"
MinorInterval="{Binding Path = MinorInterval }">
<gauge:CircularTickSet.Ticks>
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="White" ScalePlacement="Inside" EndValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor x:Name="scaleSafeMajorRange" TickMarkExtent="6" TickMarkAscent="1" Background="White"
ScalePlacement="Inside" EndValue="6.5" />
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor TickMarkExtent="6" TickMarkAscent="1"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickLabelMajor FontFamily="Verdana" FontSize="8" Foreground="White"
TextOrientation="Rotated" ScalePlacement="Inside" ScaleOffset="7"
/>
</gauge:CircularTickSet.Ticks>
<gauge:CircularTickSet.Pointers>
<gauge:CircularPointerNeedle x:Name="needle" Value="{Binding Path = Value }"
Background="{shared:LinearGradientBrush #DB0707, #FF0404, GradientType=TopToBottom}"
PointerExtent="100%" PointerAscent="3%" />
<gauge:CircularPointerCap CapType="CircleConvex"
Background="{shared:LinearGradientBrush #751515, #990E0E, GradientType=TopToBottom}"
PointerExtent="25%" />
</gauge:CircularTickSet.Pointers>
</gauge:CircularTickSet>
</gauge:CircularScale.TickSets>
</gauge:CircularScale>
</gauge:CircularGauge.Scales>
</gauge:CircularGauge>
</ControlTemplate>
<ControlTemplate x:Key="gaugeThermometer" TargetType="{ x:Type Control }">
<gauge:LinearGauge Orientation="{Binding Path = Orientation }"
Width="Auto" Height="Auto" HorizontalAlignment="Left"
Background="{shared:LinearGradientBrush #AEA498, #5E5448,
GradientType=TopLeftToBottomRight}" RimBrush="#630320" FrameType="RectangleGradient">
<gauge:LinearGauge.Scales>
<gauge:LinearScale BarExtent="80%" BarAscent="15" IsBarVisible="True">
<gauge:LinearScale.TickSets>
<gauge:LinearTickSet Maximum="{ Binding Path = Maximum }" Minimum="{ Binding Path = Minimum }"
MajorInterval="{ Binding Path = MajorInterval }" MinorInterval="{ Binding Path = MinorInterval }">
<gauge:LinearTickSet.Ticks>
<gauge:LinearTickMarkMinor x:Name="minorTickMark" TickMarkAscent="5"
TickMarkExtent="2"
Background="Black"
Visibility="Visible" />
<gauge:LinearTickMarkMajor x:Name="majorTickMark" TickMarkAscent="10"
TickMarkExtent="3"
Background="Black" />
<gauge:LinearTickMarkCustom x:Name="customTickMark" Value="{ Binding Path = Value }" TickMarkAscent="19"
TickMarkExtent="1" Background="DarkRed"
/>
<gauge:LinearTickLabelMinor x:Name="minorTickLabel" ScalePlacement="Outside"
ScaleOffset="8" Foreground="Black" FontSize="8"
/>
<gauge:LinearTickLabelMajor x:Name="majorTickLabel" ScalePlacement="Outside"
ScaleOffset="8" Foreground="Black"
/>
<gauge:LinearTickLabelCustom x:Name="customTickLabel" Value="{ Binding Path = Value }"
ScalePlacement="Inside" ScaleOffset="8" Foreground="DarkRed"
/>
</gauge:LinearTickSet.Ticks>
<gauge:LinearTickSet.Pointers>
<gauge:LinearPointerBar x:Name="bar" BarType="CircleBulbRoundedRectangle"
PointerAscent="11" PointerExtent="12" Value="{ Binding Path = Value }"
Background="{shared:LinearGradientBrush #C40000, #820000, GradientType=TopLeftToBottomRight}" />
</gauge:LinearTickSet.Pointers>
</gauge:LinearTickSet>
</gauge:LinearScale.TickSets>
</gauge:LinearScale>
</gauge:LinearGauge.Scales>
</gauge:LinearGauge>
</ControlTemplate>
</UserControl.Resources>
<Grid Height="Auto" Width="Auto" >
<Grid.RowDefinitions>
<RowDefinition ></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition> </ColumnDefinition>
</Grid.ColumnDefinitions>
<Control x:Name="ctrlGauge" Width="Auto" Height="Auto" Template="{StaticResource gaugeHalfTachometer }" Grid.Column="0" Grid.Row="0" >
</Control>
</Grid>
</UserControl>
[Modified at 10/14/2008 11:37 PM]
[Modified at 10/16/2008 10:13 AM]
i am evaluating gauge controls for the our project. when i used it in control template, it giving me the design times error. i am binding the values from the code behind dependency properties.
Error message :
Layout measurement override of element 'ActiproSoftware.Windows.Controls.Gauge.CircularScale' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size.
I am not able get the problem with this. please look at the xaml also.
<UserControl x:Class="Moog.FCS.FTS.Client.SmartClient.Controls.Meters.Gauge"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:gauge="http://schemas.actiprosoftware.com/winfx/xaml/gauge"
Height="200" Width="202" >
<UserControl.Resources>
<shared:StringFormatConverter x:Key="StringFormatConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ControlTemplate x:Key="gaugeHalfTachometer" TargetType="{ x:Type Control }">
<gauge:CircularGauge x:Name="gaugeFrame" FrameType="SemicircularRoundedRectangle" Radius="99" Background="#444444"
RimBrush="#444444" Margin="0,0,0,0">
<gauge:CircularGauge.Items>
<gauge:DigitalGauge gauge:CircularGauge.X="0" gauge:CircularGauge.Y="-30"
Width="80" Height="25"
Background="{Binding ElementName =gaugeFrame, Path = Background}"
RimBrush="{Binding ElementName =gaugeFrame, Path = RimBrush}"
CharacterType="Segment7Trapezoid" CharacterCount="7" CharacterSpacing="2"
Foreground="White" CharacterHeight="10"
Value="{Binding ElementName=needle, Path=Value,
Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:###.###0}'}" OpacityMask="Sienna" />
<TextBlock x:Name="txtTitle" gauge:CircularGauge.X="0" gauge:CircularGauge.Y="14" Text="{ Binding Path = Title}" Foreground="WhiteSmoke"
FontSize="6" />
<TextBlock x:Name="txtUnit" gauge:CircularGauge.X="37" gauge:CircularGauge.Y="60" Text="{ Binding Path = Unit}" Foreground="WhiteSmoke"
FontSize="6" />
</gauge:CircularGauge.Items>
<gauge:CircularGauge.Scales>
<gauge:CircularScale Radius="85" StartAngle="180" SweepAngle="180" BarExtent="2" IsBarVisible="False"
Background="{shared:LinearGradientBrush Gray, DarkGray, GradientType=TopToBottom}">
<gauge:CircularScale.TickSets>
<gauge:CircularTickSet Minimum="{Binding Path = Minimum }" Maximum="{Binding Path = Maximum }"
MajorInterval="{Binding Path = MajorInterval }"
MinorInterval="{Binding Path = MinorInterval }">
<gauge:CircularTickSet.Ticks>
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="White" ScalePlacement="Inside" EndValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor x:Name="scaleSafeMajorRange" TickMarkExtent="6" TickMarkAscent="1" Background="White"
ScalePlacement="Inside" EndValue="6.5" />
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor TickMarkExtent="6" TickMarkAscent="1"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickLabelMajor FontFamily="Verdana" FontSize="8" Foreground="White"
TextOrientation="Rotated" ScalePlacement="Inside" ScaleOffset="7"
/>
</gauge:CircularTickSet.Ticks>
<gauge:CircularTickSet.Pointers>
<gauge:CircularPointerNeedle x:Name="needle" Value="{Binding Path = Value }"
Background="{shared:LinearGradientBrush #DB0707, #FF0404, GradientType=TopToBottom}"
PointerExtent="100%" PointerAscent="3%" />
<gauge:CircularPointerCap CapType="CircleConvex"
Background="{shared:LinearGradientBrush #751515, #990E0E, GradientType=TopToBottom}"
PointerExtent="25%" />
</gauge:CircularTickSet.Pointers>
</gauge:CircularTickSet>
</gauge:CircularScale.TickSets>
</gauge:CircularScale>
</gauge:CircularGauge.Scales>
</gauge:CircularGauge>
</ControlTemplate>
<ControlTemplate x:Key="gaugeTachometer" TargetType="{x:Type Control}">
<gauge:CircularGauge x:Name="gaugeFrame" FrameType="CircularTopGradient" Radius="99" Background="#444444"
RimBrush="#444444" Margin="0,0,0,0">
<gauge:CircularGauge.Items>
<gauge:DigitalGauge gauge:CircularGauge.X="0" gauge:CircularGauge.Y="-30"
Width="80" Height="25"
Background="{Binding ElementName =gaugeFrame, Path = Background}"
RimBrush="{Binding ElementName =gaugeFrame, Path = RimBrush}"
CharacterType="Segment7Trapezoid" CharacterCount="7" CharacterSpacing="2"
Foreground="White" CharacterHeight="10"
Value="{Binding ElementName=needle, Path=Value,
Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:###.###0}'}" OpacityMask="Sienna" />
<TextBlock x:Name="txtTitle" gauge:CircularGauge.X="0" gauge:CircularGauge.Y="14" Text="{ Binding Path = Title}" Foreground="WhiteSmoke"
FontSize="6" />
<TextBlock x:Name="txtUnit" gauge:CircularGauge.X="37" gauge:CircularGauge.Y="60" Text="{ Binding Path = Unit}" Foreground="WhiteSmoke"
FontSize="6" />
</gauge:CircularGauge.Items>
<gauge:CircularGauge.Scales>
<gauge:CircularScale Radius="85" StartAngle="135" SweepAngle="270" BarExtent="2" IsBarVisible="False"
Background="{shared:LinearGradientBrush Gray, DarkGray, GradientType=TopToBottom}">
<gauge:CircularScale.TickSets>
<gauge:CircularTickSet Minimum="{Binding Path = Minimum }" Maximum="{Binding Path = Maximum }"
MajorInterval="{Binding Path = MajorInterval }"
MinorInterval="{Binding Path = MinorInterval }">
<gauge:CircularTickSet.Ticks>
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="White" ScalePlacement="Inside" EndValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor x:Name="scaleSafeMajorRange" TickMarkExtent="6" TickMarkAscent="1" Background="White"
ScalePlacement="Inside" EndValue="6.5" />
<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor TickMarkExtent="6" TickMarkAscent="1"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickLabelMajor FontFamily="Verdana" FontSize="8" Foreground="White"
TextOrientation="Rotated" ScalePlacement="Inside" ScaleOffset="7"
/>
</gauge:CircularTickSet.Ticks>
<gauge:CircularTickSet.Pointers>
<gauge:CircularPointerNeedle x:Name="needle" Value="{Binding Path = Value }"
Background="{shared:LinearGradientBrush #DB0707, #FF0404, GradientType=TopToBottom}"
PointerExtent="100%" PointerAscent="3%" />
<gauge:CircularPointerCap CapType="CircleConvex"
Background="{shared:LinearGradientBrush #751515, #990E0E, GradientType=TopToBottom}"
PointerExtent="25%" />
</gauge:CircularTickSet.Pointers>
</gauge:CircularTickSet>
</gauge:CircularScale.TickSets>
</gauge:CircularScale>
</gauge:CircularGauge.Scales>
</gauge:CircularGauge>
</ControlTemplate>
<ControlTemplate x:Key="gaugeThermometer" TargetType="{ x:Type Control }">
<gauge:LinearGauge Orientation="{Binding Path = Orientation }"
Width="Auto" Height="Auto" HorizontalAlignment="Left"
Background="{shared:LinearGradientBrush #AEA498, #5E5448,
GradientType=TopLeftToBottomRight}" RimBrush="#630320" FrameType="RectangleGradient">
<gauge:LinearGauge.Scales>
<gauge:LinearScale BarExtent="80%" BarAscent="15" IsBarVisible="True">
<gauge:LinearScale.TickSets>
<gauge:LinearTickSet Maximum="{ Binding Path = Maximum }" Minimum="{ Binding Path = Minimum }"
MajorInterval="{ Binding Path = MajorInterval }" MinorInterval="{ Binding Path = MinorInterval }">
<gauge:LinearTickSet.Ticks>
<gauge:LinearTickMarkMinor x:Name="minorTickMark" TickMarkAscent="5"
TickMarkExtent="2"
Background="Black"
Visibility="Visible" />
<gauge:LinearTickMarkMajor x:Name="majorTickMark" TickMarkAscent="10"
TickMarkExtent="3"
Background="Black" />
<gauge:LinearTickMarkCustom x:Name="customTickMark" Value="{ Binding Path = Value }" TickMarkAscent="19"
TickMarkExtent="1" Background="DarkRed"
/>
<gauge:LinearTickLabelMinor x:Name="minorTickLabel" ScalePlacement="Outside"
ScaleOffset="8" Foreground="Black" FontSize="8"
/>
<gauge:LinearTickLabelMajor x:Name="majorTickLabel" ScalePlacement="Outside"
ScaleOffset="8" Foreground="Black"
/>
<gauge:LinearTickLabelCustom x:Name="customTickLabel" Value="{ Binding Path = Value }"
ScalePlacement="Inside" ScaleOffset="8" Foreground="DarkRed"
/>
</gauge:LinearTickSet.Ticks>
<gauge:LinearTickSet.Pointers>
<gauge:LinearPointerBar x:Name="bar" BarType="CircleBulbRoundedRectangle"
PointerAscent="11" PointerExtent="12" Value="{ Binding Path = Value }"
Background="{shared:LinearGradientBrush #C40000, #820000, GradientType=TopLeftToBottomRight}" />
</gauge:LinearTickSet.Pointers>
</gauge:LinearTickSet>
</gauge:LinearScale.TickSets>
</gauge:LinearScale>
</gauge:LinearGauge.Scales>
</gauge:LinearGauge>
</ControlTemplate>
</UserControl.Resources>
<Grid Height="Auto" Width="Auto" >
<Grid.RowDefinitions>
<RowDefinition ></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition> </ColumnDefinition>
</Grid.ColumnDefinitions>
<Control x:Name="ctrlGauge" Width="Auto" Height="Auto" Template="{StaticResource gaugeHalfTachometer }" Grid.Column="0" Grid.Row="0" >
</Control>
</Grid>
</UserControl>
[Modified at 10/14/2008 11:37 PM]
[Modified at 10/16/2008 10:13 AM]