导出 (0) 打印
全部展开
此文章由人工翻译。 将光标移到文章的句子上,以查看原文。
译文
原文

Settings.EnableRedrawRegions 属性

Silverlight

获取或设置一个值,该值指示是否显示重新绘制每个帧的 Silverlight 插件的区域。

命名空间:  System.Windows.Interop
程序集:  System.Windows(在 System.Windows.dll 中)

public bool EnableRedrawRegions { get; set; }

属性值

类型:System.Boolean
如果显示重新绘制每个帧的 Silverlight 插件的区域,则为 true;否则为 false

EnableRedrawRegions 属性启用在开发过程中使用的诊断功能,可以通过显示重新绘制每个帧的插件的区域来优化应用程序的性能。 不能在初始化期间设置此属性。 通常,在加载 Silverlight 插件后通过使用事件处理程序来启用和禁用此属性。

下面的代码示例演示如何使用此属性。


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

受以下版本支持:5、4、3

Silverlight for Windows Phone

受以下版本支持:Windows Phone OS 7.1、Windows Phone OS 7.0

有关 Silverlight 支持的操作系统和浏览器的列表,请参见 支持的操作系统和浏览器

社区附加资源

添加
显示:
© 2014 Microsoft