July 7, 2014

StatCounter in JungleControls

StatCounter control from JungleControls library is a single header-content pair where the header is displayed above/below the content and the content itself is usually displayed with double font size. It is commonly used in dashboard views. StatCounter provides plenty of automated formatting rules for primitive data types while letting app developers to fully customize its looks.


Sample XAML:

<jc:StatCounter xmlns:jc="clr-namespace:JungleControls;assembly=JungleControls" Header="Header" Content="75%" />

Properties:
  • Header - Sets header text for the control.
  • Content - Content to display. This is usually some primitive type like double or TimeSpan. It is often string when app performs its own value formatting.
  • ContentFormatString - Format string to use when converting Content to string. It's null by default, which enables Mode property.
  • Mode - Determines how primitive values are formatted (see below) if ContentFormatString is null.
  • HeaderPosition - Determines whether header is above/below content.
  • Header* - Various visual properties of the header.
  • Content* - Various visual properties of the content.
  • Spacing - Relative amount of space between header and content. Positive value increases the spacing. Negative value reduces the spacing.

Possible Mode values:
  • Auto - Mode is Auto by default. StatCounter then chooses one of the modes below based on actual Content.
  • Integer - Uses 'N0' format string, e.g. '1,234,567'. Selected automatically for integral primitive types.
  • Float - Uses '#,##0.##' format string, e.g. '1,234.56'. Selected automatically for floating-point types and decimal unless Percent is a better choice.
  • Percent - Uses 'P0', 'P1', or 'P' format string, e.g. '37 %', '3.7 %', or '0.37%'. Selected automatically for floating-point and decimal values between 0 and 1.
  • TimeSpan - Selected automatically for TimeSpan values. It uses natural time units as can be seen in the screenshot above.
  • String - Selected if no other format fits. It causes StatCounter to simply call ToString() on the content.

No comments:

Post a Comment