C# Класс CefSharp.Wpf.ChromiumWebBrowser

Наследование: System.Windows.Controls.ContentControl, IRenderWebBrowser, IWpfWebBrowser
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
AddressProperty System.Windows.DependencyProperty
CanGoBackProperty System.Windows.DependencyProperty
CanGoForwardProperty System.Windows.DependencyProperty
CleanupElementProperty System.Windows.DependencyProperty
IsBrowserInitializedProperty System.Windows.DependencyProperty
IsLoadingProperty System.Windows.DependencyProperty
TitleProperty System.Windows.DependencyProperty
TooltipTextProperty System.Windows.DependencyProperty
WebBrowserProperty System.Windows.DependencyProperty
ZoomLevelIncrementProperty System.Windows.DependencyProperty
ZoomLevelProperty System.Windows.DependencyProperty

Private Properties

Свойство Тип Описание
ChromiumWebBrowser System
CreateImage Image
CreatePopup System.Windows.Controls.Primitives.Popup
GetDragEffects DragDropEffects
GetDragOperationsMask DragOperationsMask
GetMouseEvent MouseEvent
IRenderWebBrowser CefSharp.Internals.BitmapInfo
IRenderWebBrowser CefSharp.Internals.ScreenInfo
IRenderWebBrowser CefSharp.Internals.ViewRect
IRenderWebBrowser bool
IRenderWebBrowser void
IRenderWebBrowser void
IRenderWebBrowser void
IRenderWebBrowser void
IRenderWebBrowser void
IRenderWebBrowser void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
IWebBrowserInternal void
OnActualSizeChanged void
OnAddressChanged void
OnApplicationExit void
OnCleanupElementChanged void
OnCleanupElementUnloaded void
OnDragEnter void
OnDragLeave void
OnDragOver void
OnDrop void
OnGotKeyboardFocus void
OnIsBrowserInitializedChanged void
OnIsVisibleChanged void
OnLoaded void
OnLostKeyboardFocus void
OnMouseButton void
OnPreviewKey void
OnTitleChanged void
OnTooltipClosed void
OnTooltipTextChanged void
OnTooltipTimerTick void
OnZoomLevelChanged void
PopupMouseEnter void
PopupMouseLeave void
PresentationSourceChangedHandler void
RemoveSourceHook void
SetPopupSizeAndPositionImpl void
UiThreadRunAsync void
UiThreadRunSync void
UpdateTooltip void
ZoomIn void
ZoomOut void
ZoomReset void

Открытые методы

Метод Описание
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetBrowser ( ) : IBrowser

Returns the current IBrowser Instance

Load ( string url ) : void

Loads the specified URL.

OnApplyTemplate ( ) : void

When overridden in a derived class, is invoked whenever application code or internal processes call M:System.Windows.FrameworkElement.ApplyTemplate.

RegisterAsyncJsObject ( string name, object objectToBind, BindingOptions options = null ) : void

Asynchronously registers a Javascript object in this specific browser instance.

Only methods of the object will be availabe.

The registered methods can only be called in an async way, they will all return immeditaly and the resulting object will be a standard javascript Promise object which is usable to wait for completion or failure.

RegisterJsObject ( string name, object objectToBind, BindingOptions options = null ) : void

Registers a Javascript object in this specific browser instance.

Защищенные методы

Метод Описание
CreateOffscreenBrowser ( Size size ) : bool

Create the underlying Browser instance, can be overriden to defer control creation The browser will only be created when size > Size(0,0). If you specify a positive size then the browser will be created, if the ActualWidth and ActualHeight properties are in reality still 0 then you'll likely end up with a browser that won't render.

Dispose ( bool isDisposing ) : void

Releases unmanaged and - optionally - managed resources.

OnAddressChanged ( string oldValue, string newValue ) : void

Called when [address changed].

OnCleanupElementChanged ( FrameworkElement oldValue, FrameworkElement newValue ) : void

Called when [cleanup element changed].

OnIsBrowserInitializedChanged ( bool oldValue, bool newValue ) : void

Called when [is browser initialized changed].

OnMouseDown ( System.Windows.Input.MouseButtonEventArgs e ) : void

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnMouseLeave ( System.Windows.Input.MouseEventArgs e ) : void

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseLeave attached event is raised on this element. Implement this method to add class handling for this event.

OnMouseMove ( System.Windows.Input.MouseEventArgs e ) : void

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnMouseUp ( System.Windows.Input.MouseButtonEventArgs e ) : void

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnMouseWheel ( System.Windows.Input.MouseWheelEventArgs e ) : void

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnPreviewKeyDown ( System.Windows.Input.KeyEventArgs e ) : void

Invoked when an unhandled E:System.Windows.Input.Keyboard.PreviewKeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnPreviewKeyUp ( System.Windows.Input.KeyEventArgs e ) : void

Invoked when an unhandled E:System.Windows.Input.Keyboard.PreviewKeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnRendering ( object sender, WpfBitmapInfo bitmapInfo ) : void

Raises Rendering event

OnZoomLevelChanged ( double oldValue, double newValue ) : void

Called when [zoom level changed].

SourceHook ( IntPtr hWnd, int message, IntPtr wParam, IntPtr lParam, bool &handled ) : IntPtr

WindowProc callback interceptor. Handles Windows messages intended for the source hWnd, and passes them to the contained browser as needed.

Приватные методы

Метод Описание
ChromiumWebBrowser ( ) : System

Initializes static members of the ChromiumWebBrowser class.

CreateImage ( ) : Image

Creates the image.

CreatePopup ( ) : System.Windows.Controls.Primitives.Popup

Creates the popup.

GetDragEffects ( DragOperationsMask mask ) : DragDropEffects

Gets the drag effects.

GetDragOperationsMask ( DragDropEffects dragDropEffects ) : DragOperationsMask

Converts .NET drag drop effects to CEF Drag Operations

GetMouseEvent ( System.Windows.DragEventArgs e ) : MouseEvent

Converts a .NET Drag event to a CefSharp MouseEvent

IRenderWebBrowser ( bool isPopup ) : CefSharp.Internals.BitmapInfo

Creates the bitmap information.

IRenderWebBrowser ( ) : CefSharp.Internals.ScreenInfo

Gets the screen information.

IRenderWebBrowser ( ) : CefSharp.Internals.ViewRect

Gets the view rect.

IRenderWebBrowser ( IDragData dragData, DragOperationsMask mask, int x, int y ) : bool

Starts the dragging.

IRenderWebBrowser ( CefSharp.Internals.BitmapInfo bitmapInfo ) : void

Invokes the render asynchronous.

IRenderWebBrowser ( DragOperationsMask operation ) : void
IRenderWebBrowser ( IntPtr handle, CefCursorType type ) : void

Sets the cursor.

IRenderWebBrowser ( Range selectedRange, Rect characterBounds ) : void
IRenderWebBrowser ( bool isOpen ) : void

Sets the popup is open.

IRenderWebBrowser ( int width, int height, int x, int y ) : void

Sets the popup size and position.

IWebBrowserInternal ( AddressChangedEventArgs args ) : void

Sets the address.

IWebBrowserInternal ( ConsoleMessageEventArgs args ) : void

Handles the E:ConsoleMessage event.

IWebBrowserInternal ( FrameLoadEndEventArgs args ) : void

Handles the E:FrameLoadEnd event.

IWebBrowserInternal ( FrameLoadStartEventArgs args ) : void

Handles the E:FrameLoadStart event.

IWebBrowserInternal ( IBrowser browser ) : void

Called when [after browser created].

IWebBrowserInternal ( LoadErrorEventArgs args ) : void

Handles the E:LoadError event.

IWebBrowserInternal ( LoadingStateChangedEventArgs args ) : void

Sets the loading state change.

IWebBrowserInternal ( StatusMessageEventArgs args ) : void

Handles the E:StatusMessage event.

IWebBrowserInternal ( TitleChangedEventArgs args ) : void

Sets the title.

IWebBrowserInternal ( string tooltipText ) : void

Sets the tooltip text.

OnActualSizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void

Handles the E:ActualSizeChanged event.

OnAddressChanged ( DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs args ) : void

Handles the E:AddressChanged event.

OnApplicationExit ( object sender, System.Windows.ExitEventArgs e ) : void

Handles the E:ApplicationExit event.

OnCleanupElementChanged ( DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs args ) : void

Handles the E:CleanupElementChanged event.

OnCleanupElementUnloaded ( object sender, RoutedEventArgs e ) : void

Handles the E:CleanupElementUnloaded event.

OnDragEnter ( object sender, System.Windows.DragEventArgs e ) : void

Handles the E:DragEnter event.

OnDragLeave ( object sender, System.Windows.DragEventArgs e ) : void

Handles the E:DragLeave event.

OnDragOver ( object sender, System.Windows.DragEventArgs e ) : void

Handles the E:DragOver event.

OnDrop ( object sender, System.Windows.DragEventArgs e ) : void

Handles the E:Drop event.

OnGotKeyboardFocus ( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

Handles the E:GotKeyboardFocus event.

OnIsBrowserInitializedChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles the E:IsBrowserInitializedChanged event.

OnIsVisibleChanged ( object sender, System.Windows.DependencyPropertyChangedEventArgs args ) : void

Handles the E:IsVisibleChanged event.

OnLoaded ( object sender, RoutedEventArgs routedEventArgs ) : void

Handles the E:Loaded event.

OnLostKeyboardFocus ( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

Handles the E:LostKeyboardFocus event.

OnMouseButton ( System.Windows.Input.MouseButtonEventArgs e ) : void

Handles the E:MouseButton event.

OnPreviewKey ( System.Windows.Input.KeyEventArgs e ) : void

Handles the E:PreviewKey event.

OnTitleChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles the E:TitleChanged event.

OnTooltipClosed ( object sender, RoutedEventArgs e ) : void

Handles the E:TooltipClosed event.

OnTooltipTextChanged ( ) : void

Called when [tooltip text changed].

OnTooltipTimerTick ( object sender, EventArgs e ) : void

Handles the E:TooltipTimerTick event.

OnZoomLevelChanged ( DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs args ) : void

Handles the E:ZoomLevelChanged event.

PopupMouseEnter ( object sender, System.Windows.Input.MouseEventArgs e ) : void

Handle the mouse cursor entering the pop-up.

PopupMouseLeave ( object sender, System.Windows.Input.MouseEventArgs e ) : void

Handle the mouse cursor exiting the pop-up.

PresentationSourceChangedHandler ( object sender, System.Windows.SourceChangedEventArgs args ) : void

PresentationSource changed handler.

RemoveSourceHook ( ) : void

Removes the source hook.

SetPopupSizeAndPositionImpl ( int width, int height, int x, int y ) : void

Sets the popup size and position implementation.

UiThreadRunAsync ( System.Action action, DispatcherPriority priority = DispatcherPriority.DataBind ) : void

Runs the specific Action on the Dispatcher in an async fashion

UiThreadRunSync ( System.Action action, DispatcherPriority priority = DispatcherPriority.DataBind ) : void

Runs the specific Action on the Dispatcher in an sync fashion

UpdateTooltip ( string text ) : void

Updates the tooltip.

ZoomIn ( ) : void

Zooms the browser in.

ZoomOut ( ) : void

Zooms the browser out.

ZoomReset ( ) : void

Reset the browser's zoom level to default.

Описание методов

CreateOffscreenBrowser() защищенный Метод

Create the underlying Browser instance, can be overriden to defer control creation The browser will only be created when size > Size(0,0). If you specify a positive size then the browser will be created, if the ActualWidth and ActualHeight properties are in reality still 0 then you'll likely end up with a browser that won't render.
protected CreateOffscreenBrowser ( Size size ) : bool
size System.Windows.Size size of the current control, must be greater than Size(0, 0)
Результат bool

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool isDisposing ) : void
isDisposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Результат void

GetBrowser() публичный Метод

Returns the current IBrowser Instance
public GetBrowser ( ) : IBrowser
Результат IBrowser

Load() публичный Метод

Loads the specified URL.
public Load ( string url ) : void
url string The URL to be loaded.
Результат void

OnAddressChanged() защищенный Метод

Called when [address changed].
protected OnAddressChanged ( string oldValue, string newValue ) : void
oldValue string The old value.
newValue string The new value.
Результат void

OnApplyTemplate() публичный Метод

When overridden in a derived class, is invoked whenever application code or internal processes call M:System.Windows.FrameworkElement.ApplyTemplate.
public OnApplyTemplate ( ) : void
Результат void

OnCleanupElementChanged() защищенный Метод

Called when [cleanup element changed].
protected OnCleanupElementChanged ( FrameworkElement oldValue, FrameworkElement newValue ) : void
oldValue System.Windows.FrameworkElement The old value.
newValue System.Windows.FrameworkElement The new value.
Результат void

OnIsBrowserInitializedChanged() защищенный Метод

Called when [is browser initialized changed].
protected OnIsBrowserInitializedChanged ( bool oldValue, bool newValue ) : void
oldValue bool if set to true [old value].
newValue bool if set to true [new value].
Результат void

OnMouseDown() защищенный Метод

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnMouseDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs The that contains the event data. /// This event data reports details about the mouse button that was pressed and the handled state.
Результат void

OnMouseLeave() защищенный Метод

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseLeave attached event is raised on this element. Implement this method to add class handling for this event.
protected OnMouseLeave ( System.Windows.Input.MouseEventArgs e ) : void
e System.Windows.Input.MouseEventArgs The that contains the event data.
Результат void

OnMouseMove() защищенный Метод

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnMouseMove ( System.Windows.Input.MouseEventArgs e ) : void
e System.Windows.Input.MouseEventArgs The that contains the event data.
Результат void

OnMouseUp() защищенный Метод

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnMouseUp ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs The that contains the event data. The event data reports that the mouse button was released.
Результат void

OnMouseWheel() защищенный Метод

Invoked when an unhandled E:System.Windows.Input.Mouse.MouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnMouseWheel ( System.Windows.Input.MouseWheelEventArgs e ) : void
e System.Windows.Input.MouseWheelEventArgs The that contains the event data.
Результат void

OnPreviewKeyDown() защищенный Метод

Invoked when an unhandled E:System.Windows.Input.Keyboard.PreviewKeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnPreviewKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs The that contains the event data.
Результат void

OnPreviewKeyUp() защищенный Метод

Invoked when an unhandled E:System.Windows.Input.Keyboard.PreviewKeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnPreviewKeyUp ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs The that contains the event data.
Результат void

OnRendering() защищенный Метод

Raises Rendering event
protected OnRendering ( object sender, WpfBitmapInfo bitmapInfo ) : void
sender object The sender.
bitmapInfo WpfBitmapInfo The bitmap information.
Результат void

OnZoomLevelChanged() защищенный Метод

Called when [zoom level changed].
protected OnZoomLevelChanged ( double oldValue, double newValue ) : void
oldValue double The old value.
newValue double The new value.
Результат void

RegisterAsyncJsObject() публичный Метод

Asynchronously registers a Javascript object in this specific browser instance.

Only methods of the object will be availabe.

The registered methods can only be called in an async way, they will all return immeditaly and the resulting object will be a standard javascript Promise object which is usable to wait for completion or failure.
Browser is already initialized. RegisterJsObject must be + /// called before the underlying CEF browser is created.
public RegisterAsyncJsObject ( string name, object objectToBind, BindingOptions options = null ) : void
name string The name of the object. (e.g. "foo", if you want the object to be accessible as window.foo).
objectToBind object The object to be made accessible to Javascript.
options BindingOptions binding options - camelCaseJavascriptNames default to true
Результат void

RegisterJsObject() публичный Метод

Registers a Javascript object in this specific browser instance.
Browser is already initialized. RegisterJsObject must be + /// called before the underlying CEF browser is created.
public RegisterJsObject ( string name, object objectToBind, BindingOptions options = null ) : void
name string The name of the object. (e.g. "foo", if you want the object to be accessible as window.foo).
objectToBind object The object to be made accessible to Javascript.
options BindingOptions binding options - camelCaseJavascriptNames default to true
Результат void

SourceHook() защищенный Метод

WindowProc callback interceptor. Handles Windows messages intended for the source hWnd, and passes them to the contained browser as needed.
protected SourceHook ( IntPtr hWnd, int message, IntPtr wParam, IntPtr lParam, bool &handled ) : IntPtr
hWnd System.IntPtr The source handle.
message int The message.
wParam System.IntPtr Additional message info.
lParam System.IntPtr Even more message info.
handled bool if set to true, the event has already been handled by someone else.
Результат System.IntPtr

Описание свойств

AddressProperty публичное статическое свойство

The address property
public static DependencyProperty,System.Windows AddressProperty
Результат System.Windows.DependencyProperty

CanGoBackProperty публичное статическое свойство

The can go back property
public static DependencyProperty,System.Windows CanGoBackProperty
Результат System.Windows.DependencyProperty

CanGoForwardProperty публичное статическое свойство

The can go forward property
public static DependencyProperty,System.Windows CanGoForwardProperty
Результат System.Windows.DependencyProperty

CleanupElementProperty публичное статическое свойство

The cleanup element property
public static DependencyProperty,System.Windows CleanupElementProperty
Результат System.Windows.DependencyProperty

IsBrowserInitializedProperty публичное статическое свойство

The is browser initialized property
public static DependencyProperty,System.Windows IsBrowserInitializedProperty
Результат System.Windows.DependencyProperty

IsLoadingProperty публичное статическое свойство

The is loading property
public static DependencyProperty,System.Windows IsLoadingProperty
Результат System.Windows.DependencyProperty

TitleProperty публичное статическое свойство

The title property
public static DependencyProperty,System.Windows TitleProperty
Результат System.Windows.DependencyProperty

TooltipTextProperty публичное статическое свойство

The tooltip text property
public static DependencyProperty,System.Windows TooltipTextProperty
Результат System.Windows.DependencyProperty

WebBrowserProperty публичное статическое свойство

The WebBrowser property
public static DependencyProperty,System.Windows WebBrowserProperty
Результат System.Windows.DependencyProperty

ZoomLevelIncrementProperty публичное статическое свойство

The zoom level increment property
public static DependencyProperty,System.Windows ZoomLevelIncrementProperty
Результат System.Windows.DependencyProperty

ZoomLevelProperty публичное статическое свойство

The zoom level property
public static DependencyProperty,System.Windows ZoomLevelProperty
Результат System.Windows.DependencyProperty