Export (0) Print
Expand All

Settings Class

Silverlight

Reports details about the Silverlight-based application's instantiation settings, and exposes some of the HTML DOM values for the hosted Silverlight plug-in instance.

System.Object
  System.Windows.Interop.Settings

Namespace:  System.Windows.Interop
Assembly:  System.Windows (in System.Windows.dll)

public sealed class Settings

The Settings type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneSettingsInfrastructure. Initializes a new instance of the Settings object.
Top

  NameDescription
Public propertyDefaultDesignImageGets or sets a stream associated with a PNG image to be displayed by the host when the Silverlight application is not executing.
Public propertyEnableAutoZoomGets or sets a value that indicates whether the Silverlight plug-in will resize its content based on the current browser zoom setting.
Public propertySupported by Silverlight for Windows PhoneEnableCacheVisualizationGets or sets a value that indicates whether to use a non-production analysis visualization mode, which shows areas of a page that are not being GPU accelerated with a colored overlay. Do not use in production code.
Public propertySupported by Silverlight for Windows PhoneEnableFrameRateCounterGets or sets a value that indicates whether to display the current frame rate in the hosting browser's status bar. (Microsoft Internet Explorer only.)
Public propertySupported by Silverlight for Windows PhoneEnableGPUAccelerationGets a value that indicates whether to use graphics processor unit (GPU) hardware acceleration for cached compositions, which potentially results in graphics optimization.
Public propertyEnableHTMLAccessGets a value that indicates whether the Silverlight plug-in allows hosted content or its runtime to access the HTML DOM.
Public propertySupported by Silverlight for Windows PhoneEnableRedrawRegionsGets or sets a value that indicates whether to show the areas of the Silverlight plug-in that are being redrawn each frame.
Public propertySupported by Silverlight for Windows PhoneMaxFrameRateGets or sets the maximum number of frames to render per second.
Public propertyWindowlessGets a value that indicates whether the Silverlight plug-in displays as a windowless plug-in. (Applies to Windows versions of Silverlight only.)
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The Settings class contains APIs that specifically relate to aspects of the HTML DOM outside of the Silverlight content area (the area declared by the width and height in the initialization).

This object is always the value of the SilverlightHost.Settings property of a parent SilverlightHost, and this is the only context in which a Settings object is used.

The following code example demonstrates how to use this class.


// 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft