Track.Maximum Property

Gets or sets the maximum possible Value of the Track.

Namespace: System.Windows.Controls.Primitives
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public double Maximum { get; set; }
/** @property */
public double get_Maximum ()

/** @property */
public void set_Maximum (double value)

public function get Maximum () : double

public function set Maximum (value : double)

<object Maximum="double" .../>

Property Value

The largest allowable Value for the Track. The default value is one (1).

When a Track control is in a RangeBase control and the Track.Maximum property is not explicitly set, this property automatically binds with the RangeBase.Maximum property.

The Maximum value for a ScrollBar control is equivalent to the size of the scrollable content minus the size of the visible content area or viewport. For example, if the size of the content is 100 and the size of the ViewportSize property is 30, the value of the Maximum property is 70. This is true because the Value property of the ScrollBar control corresponds to the position in the scrollable content that appears at the top of the viewport. When the content is scrolled to the very bottom in this example, 30 percent of the content still appears in the viewport. Therefore, the Value that corresponds to the top of the viewport is 70, and the Maximum value is 70.

The following illustration shows how the Value corresponds to a position in the ScrollBar of a ScrollViewer control.

The following example shows how to set the Maximum property for a Slider that becomes the binding source for the Track.Maximum property. For the complete sample, see Slider Sample.

<Slider Name="slider1" Width="100" 
        Orientation="Horizontal" HorizontalAlignment="Left" 
        IsSnapToTickEnabled="True" Minimum="1" Maximum="9" 
        TickPlacement="BottomRight"  TickFrequency="3"
        AutoToolTipPrecision="2" AutoToolTipPlacement="BottomRight"
        IsDirectionReversed="False"
        IsMoveToPointEnabled="False"/>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: