Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Settings.MaxFrameRate Property

Silverlight

Gets or sets the maximum number of frames to render per second.

Namespace:  System.Windows.Interop
Assembly:  System.Windows (in System.Windows.dll)
public int MaxFrameRate { get; set; }

Property Value

Type: System.Int32
An integer value that specifies the maximum number of frames to render per second. The default value is 60.

The actual frame rate that Silverlight content renders depends on system load performance. You can specify the range using the MaxFrameRate property:

  • The minimum frame rate is 1.

  • The maximum frame rate is platform-dependent. A value of approximately 60 frames-per-second should be reliable on all platforms. The 1000 and 30000 frames-per-second range is where the maximum frame rate could differ between platforms.

Note that there is a mismatch in naming between the parameter in createObject/createObjectEx and the runtime property. The instantiation parameter is named framerate, this runtime property is named MaxFrameRate, but these are both referring to the same value.

You can display a frame rate counter for diagnostic purposes. Fore more information, see EnableFrameRateCounter.

The following code example demonstrates how to use this property.


// The Host object, which represents the host Silverlight plug-in.
System.Windows.Interop.SilverlightHost host = 
    Application.Current.Host;

// The following code demonstrates how to use the Host object
// to access other APIs in the System.Windows.Interop namespace.

// The IsVersionSupported method. This method is useful when
// you want to implement an upgrade experience in managed code.
bool isSupported = host.IsVersionSupported("2.0.30908.0");

// Read-only properties of the Host object.
System.Windows.Media.Color pluginBackground = host.Background;
bool loaded = host.IsLoaded;
Uri source = host.Source;

// The Settings object, which represents Web browser settings.
System.Windows.Interop.Settings settings = host.Settings;

// Read/write properties of the Settings object.
settings.EnableFrameRateCounter = true;
settings.EnableRedrawRegions = true;
settings.MaxFrameRate = 60;

// Read-only properties of the Settings object.
bool windowless = settings.Windowless;
bool htmlAccessEnabled = settings.EnableHTMLAccess;

// The Content object, which represents the plug-in display area.
System.Windows.Interop.Content content = host.Content;

// The read/write IsFullScreen property of the Content object.
// See also the Content.FullScreenChanged event.
bool isFullScreen = content.IsFullScreen;

// Read-only properties of the Content object. These properties do 
// not contain meaningful values until after the Content.Resized 
// event occurs for the first time. 
double actualWidth = content.ActualWidth;
double actualHeight = content.ActualHeight;


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.