129 lines
5.2 KiB
VB.net
129 lines
5.2 KiB
VB.net
Imports System.Globalization
|
|
Imports System.Windows.Controls.Primitives
|
|
Imports System.ComponentModel
|
|
|
|
|
|
Public Class CheckParamV
|
|
Implements INotifyPropertyChanged
|
|
|
|
Sub New()
|
|
InitializeComponent()
|
|
End Sub
|
|
|
|
Private m_ccc As String
|
|
Public Property ccc As String
|
|
Get
|
|
Return m_ccc
|
|
End Get
|
|
Set(value As String)
|
|
m_ccc = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Shared ReadOnly ParamTxBlProperty As DependencyProperty =
|
|
DependencyProperty.Register("ParamTxBl", GetType(String), GetType(CheckParamV))
|
|
Public Property ParamTxBl As String
|
|
Get
|
|
Return CStr(GetValue(ParamTxBlProperty))
|
|
End Get
|
|
Set(value As String)
|
|
SetValue(ParamTxBlProperty, value)
|
|
End Set
|
|
End Property
|
|
|
|
Public Shared ReadOnly ParamChBxProperty As DependencyProperty =
|
|
DependencyProperty.Register("ParamChBx", GetType(Boolean), GetType(CheckParamV), New FrameworkPropertyMetadata() With {.BindsTwoWayByDefault = True})
|
|
Public Property ParamChBx As Boolean
|
|
Get
|
|
Return CBool(GetValue(ParamChBxProperty))
|
|
End Get
|
|
Set(value As Boolean)
|
|
SetValue(ParamChBxProperty, value)
|
|
End Set
|
|
End Property
|
|
|
|
' ------------------------------------------------------------------- Colore TextBlock -------------------------------------------------------------------
|
|
'Public Shared ReadOnly ForegroundParamTxBlProperty As DependencyProperty =
|
|
' DependencyProperty.Register("ForegroundParamTxBl",
|
|
' GetType(Windows.Media.Brush),
|
|
' GetType(CheckParamV),
|
|
' New PropertyMetadata(Windows.Media.Brushes.Black))
|
|
'Public Property ForegroundParamTxBl() As Windows.Media.Brush
|
|
' Get
|
|
' Return DirectCast(GetValue(ForegroundParamTxBlProperty), Windows.Media.Brush)
|
|
' End Get
|
|
' Set(ByVal value As Windows.Media.Brush)
|
|
' SetValue(ForegroundParamTxBlProperty, value)
|
|
' End Set
|
|
'End Property
|
|
Public Shared ReadOnly ForegroundChxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
|
|
NameOf(ForegroundChxTxBl),
|
|
GetType(Brush),
|
|
GetType(CheckParamV),
|
|
New FrameworkPropertyMetadata(SystemColors.WindowTextBrush, FrameworkPropertyMetadataOptions.[Inherits]))
|
|
' Declare a get accessor method.
|
|
Public Shared Function GetForegroundChxTxBl(element As CheckParamV) As Brush
|
|
Return DirectCast(element.GetValue(ForegroundChxTxBlProperty), Brush)
|
|
End Function
|
|
|
|
' Declare a set accessor method.
|
|
Public Shared Sub SetForegroundChxTxBl(element As CheckParamV, value As Brush)
|
|
element.SetValue(ForegroundChxTxBlProperty, value)
|
|
End Sub
|
|
|
|
Public Property ForegroundChxTxBl As Brush
|
|
Get
|
|
Return DirectCast(GetValue(ForegroundChxTxBlProperty), Brush)
|
|
End Get
|
|
Set(ByVal value As Brush)
|
|
SetValue(ForegroundChxTxBlProperty, value)
|
|
End Set
|
|
End Property
|
|
' ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
'Private Shared Sub OnParamTxBxChangedCallback(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
|
|
' Dim StringParamV As StringParamV = DirectCast(sender, StringParamV)
|
|
' If Not IsNothing(sender) Then
|
|
' 'StringParamV.ParamValue.Text = CStr(e.NewValue)
|
|
' StringParamV.ParamTxBx = CStr(e.NewValue)
|
|
' StringParamV.NotifyPropertyChanged("ParamTxBx")
|
|
' End If
|
|
'End Sub
|
|
|
|
'Public Property ParamErrorMsg() As String
|
|
' Get
|
|
' Return CStr(GetValue(ParamErrorMsgProperty))
|
|
' End Get
|
|
' Set(ByVal value As String)
|
|
' SetValue(ParamErrorMsgProperty, value)
|
|
' End Set
|
|
'End Property
|
|
|
|
'Public Shared ReadOnly ParamErrorMsgProperty As DependencyProperty =
|
|
' DependencyProperty.Register("ParamErrorMsg", GetType(String), GetType(CheckParamV))
|
|
|
|
'Public Property ParamVisibility() As Visibility
|
|
' Get
|
|
' Return CType(GetValue(ParamVisibilityProperty), Visibility)
|
|
' End Get
|
|
' Set(ByVal value As Visibility)
|
|
' SetValue(ParamVisibilityProperty, value)
|
|
' End Set
|
|
'End Property
|
|
|
|
'Friend Sub ParamValue_TextChanged(sender As Object, e As TextChangedEventArgs) Handles ParamValue.TextChanged
|
|
' ParamTxBx = ParamValue.Text
|
|
'End Sub
|
|
|
|
Public Shared ReadOnly ParamVisibilityProperty As DependencyProperty =
|
|
DependencyProperty.Register("ParamVisibility", GetType(Visibility), GetType(CheckParamV))
|
|
|
|
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
|
|
|
Public Sub NotifyPropertyChanged(propName As String)
|
|
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
|
End Sub
|
|
|
|
End Class
|
|
|