編輯

共用方式為


BaseUriHelper.GetBaseUri(DependencyObject) Method

Definition

Gets the value of the BaseUri for a specified UIElement.

public:
 static Uri ^ GetBaseUri(System::Windows::DependencyObject ^ element);
[System.Security.SecurityCritical]
public static Uri GetBaseUri (System.Windows.DependencyObject element);
public static Uri GetBaseUri (System.Windows.DependencyObject element);
[<System.Security.SecurityCritical>]
static member GetBaseUri : System.Windows.DependencyObject -> Uri
static member GetBaseUri : System.Windows.DependencyObject -> Uri
Public Shared Function GetBaseUri (element As DependencyObject) As Uri

Parameters

element
DependencyObject

The element from which the property value is read.

Returns

Uri

The base URI of a given element.

Attributes

Exceptions

element is null.

Remarks

Use this method to get the IUriContext.BaseUri property if it is implemented or the BaseUri attached property if is set on an element. GetBaseUri will traverse the parent elements of element to search for the nearest BaseUri (IUriContext or attached property).

Applies to