BaseUriHelper.GetBaseUri Method (DependencyObject)

 

Gets the value of the BaseUri for a specified UIElement.

Namespace:   System.Windows.Navigation
Assembly:  PresentationCore (in PresentationCore.dll)

[SecurityCriticalAttribute]
public static Uri GetBaseUri(
	DependencyObject element
)

Parameters

element
Type: System.Windows.DependencyObject

The element from which the property value is read.

Return Value

Type: System.Uri

The base URI of a given element.

Exception Condition
ArgumentNullException

element is null.

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

FileIOPermission

for getting the value of the BaseUri attached property. Associated enumeration: FileIOPermissionAccess.PathDiscovery

.NET Framework
Available since 3.0
Return to top
Show: