BaseUriHelper.GetBaseUri(DependencyObject) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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).