Namespace Wpf.Controls ''<remarks> '' Copyright (c) 2008, Rahul Singla (See License.txt) '' </remarks> ''' <summary> ''' Defines the type used by the BindingOverrideProperty in the ErrorProvider. ''' </summary> Public Class BindingOverride Private _ownerType As Type Private _path As String Private _overrideRelativeSource As RelativeSourceMode = RelativeSourceMode.Self Public Property ownerType() As Type Get Return (Me._ownerType) End Get Set(ByVal value As Type) Me._ownerType = value End Set End Property Public Property path() As String Get Return (Me._path) End Get Set(ByVal value As String) Me._path = value End Set End Property Public Property overrideRelativeSource() As RelativeSourceMode Get Return (Me._overrideRelativeSource) End Get Set(ByVal value As RelativeSourceMode) Select Case value Case RelativeSourceMode.PreviousData, RelativeSourceMode.Self Me._overrideRelativeSource = value Case Else Throw New Exception("Only PreviousData and Self are supported as overrideRelativesource") End Select End Set End Property End Class ''' <summary> ''' A MarkupExtension for the BindingOverride used in the ErrorProvider. ''' </summary> Public Class BindingOverrideExtension Inherits Markup.MarkupExtension Private _bindingOverride As New BindingOverride Public Property ownerType() As Type Get Return (Me._bindingOverride.ownerType) End Get Set(ByVal value As Type) Me._bindingOverride.ownerType = value End Set End Property Public Property path() As String Get Return (Me._bindingOverride.path) End Get Set(ByVal value As String) Me._bindingOverride.path = value End Set End Property Public Property overrideRelativeSource() As RelativeSourceMode Get Return (Me._bindingOverride.overrideRelativeSource) End Get Set(ByVal value As RelativeSourceMode) Me._bindingOverride.overrideRelativeSource = value End Set End Property Public Overrides Function ProvideValue(ByVal serviceProvider As System.IServiceProvider) As Object Return (Me._bindingOverride) End Function End Class End Namespace
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)