Files
EgtWPFLib5/ComboParamV.xaml.vb
2025-03-21 23:42:17 +01:00

406 lines
21 KiB
VB.net

Imports System.ComponentModel
Imports System.Collections.ObjectModel
Public Class ComboParamV
Implements INotifyPropertyChanged
Sub New()
InitializeComponent()
End Sub
Public Shared ReadOnly ParamTxBlProperty As DependencyProperty = DependencyProperty.Register("ParamTxBl", GetType(String), GetType(ComboParamV))
Public Property ParamTxBl As String
Get
Return CStr(GetValue(ParamTxBlProperty))
End Get
Set(value As String)
SetValue(ParamTxBlProperty, value)
End Set
End Property
' Proprietà che permette di impostare l'altezza della TitleBar
Public Shared ReadOnly ForegroundParamCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(ForegroundParamCmBxTxBl),
GetType(Windows.Media.Brush),
GetType(ComboParamV),
New FrameworkPropertyMetadata(Windows.Media.Brushes.Black, FrameworkPropertyMetadataOptions.[Inherits]))
' Declare a get accessor method.
Public Shared Function GetForegroundParamCmBxTxBl(element As ComboParamV) As Windows.Media.Brush
Return DirectCast(element.GetValue(ForegroundParamCmBxTxBlProperty), Windows.Media.Brush)
End Function
' Declare a set accessor method.
Public Shared Sub SetForegroundParamCmBxTxBl(element As ComboParamV, value As Windows.Media.Brush)
element.SetValue(ForegroundParamCmBxTxBlProperty, value)
End Sub
Public Property ForegroundParamCmBxTxBl As Windows.Media.Brush
Get
Return DirectCast(GetValue(ForegroundParamCmBxTxBlProperty), Windows.Media.Brush)
End Get
Set(ByVal value As Windows.Media.Brush)
SetValue(ForegroundParamCmBxTxBlProperty, value)
End Set
End Property
' ---------------------------------------------------------------------------------------------------------------------------------------------------------
Public Shared ReadOnly ParamCmBxListProperty As DependencyProperty =
DependencyProperty.Register("ParamCmBxList", GetType(ObservableCollection(Of Object)), GetType(ComboParamV), New FrameworkPropertyMetadata() With {.BindsTwoWayByDefault = False})
Public Property ParamCmBxList As ObservableCollection(Of Object)
Get
Return CType(GetValue(ParamCmBxListProperty), ObservableCollection(Of Object))
End Get
Set(value As ObservableCollection(Of Object))
SetValue(ParamCmBxListProperty, value)
End Set
End Property
Public Shared ReadOnly ParamCmBxSelIndexProperty As DependencyProperty =
DependencyProperty.Register("ParamCmBxSelIndex", GetType(Integer), GetType(ComboParamV), New FrameworkPropertyMetadata() With {.BindsTwoWayByDefault = True})
Public Property ParamCmBxSelIndex As Integer
Get
Return CInt(GetValue(ParamCmBxSelIndexProperty))
End Get
Set(value As Integer)
SetValue(ParamCmBxSelIndexProperty, value)
End Set
End Property
Public Shared ReadOnly ParamDisplayMemberPathProperty As DependencyProperty =
DependencyProperty.Register("ParamDisplayMemberPath", GetType(String), GetType(ComboParamV), New FrameworkPropertyMetadata() With {.BindsTwoWayByDefault = False})
Public Property ParamDisplayMemberPath As String
Get
Return CStr(GetValue(ParamDisplayMemberPathProperty))
End Get
Set(value As String)
SetValue(ParamDisplayMemberPathProperty, value)
End Set
End Property
Public Shared ReadOnly ParamVisibilityProperty As DependencyProperty =
DependencyProperty.Register("ParamVisibility", GetType(Visibility), GetType(ComboParamV))
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
Public Shared ReadOnly ParamErrorMsgProperty As DependencyProperty =
DependencyProperty.Register("ParamErrorMsg", GetType(String), GetType(ComboParamV))
Public Property ParamErrorMsg() As String
Get
Return CStr(GetValue(ParamErrorMsgProperty))
End Get
Set(ByVal value As String)
SetValue(ParamErrorMsgProperty, value)
End Set
End Property
#Region "COMBOBOX MANAGE PAGE"
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~GESTIONE BACKGROUNDCOLOR COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Shared ReadOnly BackgroundCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(BackgroundCmBxTxBl),
GetType(Brush),
GetType(ComboParamV),
New FrameworkPropertyMetadata(New LinearGradientBrush(CType(ColorConverter.ConvertFromString("#E5E5E5"), Color), CType(ColorConverter.ConvertFromString("#F0F0F0"), Color), New Point(0.0, 0.1), New Point(0.1, 0.0)),
New PropertyChangedCallback(AddressOf BackgroundCmBxTxBl_PropertyChanged)) With {.BindsTwoWayByDefault = True})
' Declare a get accessor method.
Public Shared Function GetBackgroundCmBxTxBl(element As ComboParamV) As Brush
Return DirectCast(element.GetValue(BackgroundCmBxTxBlProperty), Brush)
End Function
' Declare a set accessor method.
Public Shared Sub SetBackgroundCmBxTxBl(element As ComboParamV, value As Brush)
element.SetValue(BackgroundCmBxTxBlProperty, value)
End Sub
' Declare public property.
Public Property BackgroundCmBxTxBl As Brush
Get
Return CType(GetValue(BackgroundCmBxTxBlProperty), Brush)
End Get
Set(value As Brush)
SetValue(BackgroundCmBxTxBlProperty, value)
End Set
End Property
' Declare method invoke by changing property.
Private Shared Sub BackgroundCmBxTxBl_PropertyChanged(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim TempMe As ComboParamV = DirectCast(sender, ComboParamV)
End Sub
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~GESTIONE FOREGROUND COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Shared ReadOnly ForegroundCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(ForegroundCmBxTxBl),
GetType(Brush),
GetType(ComboParamV),
New FrameworkPropertyMetadata(SystemColors.WindowTextBrush, New PropertyChangedCallback(AddressOf ForegroundCmBxTxBl_PropertyChanged)) With {.BindsTwoWayByDefault = True})
' Declare a get accessor method.
Public Shared Function GetForegroundCmBxTxBl(element As ComboParamV) As Brush
Return DirectCast(element.GetValue(ForegroundCmBxTxBlProperty), Brush)
End Function
' Declare a set accessor method.
Public Shared Sub SetForegroundCmBxTxBl(element As ComboParamV, value As Brush)
element.SetValue(ForegroundCmBxTxBlProperty, value)
End Sub
' Declare public property.
Public Property ForegroundCmBxTxBl As Brush
Get
Return CType(GetValue(ForegroundCmBxTxBlProperty), Brush)
End Get
Set(value As Brush)
SetValue(ForegroundCmBxTxBlProperty, value)
End Set
End Property
' Declare method invoke by changing property.
Private Shared Sub ForegroundCmBxTxBl_PropertyChanged(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim TempMe As ComboParamV = DirectCast(sender, ComboParamV)
End Sub
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SPESSORE BORDER COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Proprietà che permette di impostare l'altezza della TitleBar
Public Shared ReadOnly BorderThicknessCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(BorderThicknessCmBxTxBl),
GetType(Thickness),
GetType(ComboParamV),
New FrameworkPropertyMetadata(New Thickness(1), New PropertyChangedCallback(AddressOf BorderThicknessCmBxTxBl_PropertyChanged)) With {.BindsTwoWayByDefault = True})
' Declare a get accessor method.
Public Shared Function GetBorderThicknessCmBxTxBl(element As ComboParamV) As Thickness
Return DirectCast(element.GetValue(BorderThicknessCmBxTxBlProperty), Thickness)
End Function
' Declare a set accessor method.
Public Shared Sub SetBorderThicknessCmBxTxBl(element As ComboParamV, value As Thickness)
element.SetValue(BorderThicknessCmBxTxBlProperty, value)
End Sub
Public Property BorderThicknessCmBxTxBl As Thickness
Get
Return DirectCast(GetValue(BorderThicknessCmBxTxBlProperty), Thickness)
End Get
Set(ByVal value As Thickness)
SetValue(BorderThicknessCmBxTxBlProperty, value)
End Set
End Property
' Declare method invoke by changing property.
Private Shared Sub BorderThicknessCmBxTxBl_PropertyChanged(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim TempMe As ComboParamV = DirectCast(sender, ComboParamV)
End Sub
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~COLORE BORDER COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Shared ReadOnly BorderBrushCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(BorderBrushCmBxTxBl),
GetType(Brush),
GetType(ComboParamV),
New FrameworkPropertyMetadata(DirectCast(New BrushConverter().ConvertFromString("#ACACAC"), Brush),
New PropertyChangedCallback(AddressOf BorderBrushCmBxTxBl_PropertyChanged)) With {.BindsTwoWayByDefault = True})
' Declare a get accessor method.
Public Shared Function GetBorderBrushCmBxTxBl(element As ComboParamV) As Brush
Return DirectCast(element.GetValue(BorderBrushCmBxTxBlProperty), Brush)
End Function
' Declare a set accessor method.
Public Shared Sub SetBorderBrushCmBxTxBl(element As ComboParamV, value As Brush)
element.SetValue(BorderBrushCmBxTxBlProperty, value)
End Sub
' Declare public property.
Public Property BorderBrushCmBxTxBl As Brush
Get
Return CType(GetValue(BorderBrushCmBxTxBlProperty), Brush)
End Get
Set(value As Brush)
SetValue(BorderBrushCmBxTxBlProperty, value)
End Set
End Property
' Declare method invoke by changing property.
Private Shared Sub BorderBrushCmBxTxBl_PropertyChanged(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim TempMe As ComboParamV = DirectCast(sender, ComboParamV)
End Sub
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ALLINIAMENTO VERTICALE CONTENUTO COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Proprietà che permette di impostare l'altezza della TitleBar
Public Shared ReadOnly VerticalContentAlignmentCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(VerticalContentAlignmentCmBxTxBl),
GetType(String),
GetType(ComboParamV),
New FrameworkPropertyMetadata("Center", FrameworkPropertyMetadataOptions.[Inherits]))
' Declare a get accessor method.
Public Shared Function GetVerticalContentAlignmentCmBxTxBl(element As ComboParamV) As String
Return DirectCast(element.GetValue(VerticalContentAlignmentCmBxTxBlProperty), String)
End Function
' Declare a set accessor method.
Public Shared Sub SetVerticalContentAlignmentCmBxTxBl(element As ComboParamV, value As String)
element.SetValue(VerticalContentAlignmentCmBxTxBlProperty, value)
End Sub
Public Property VerticalContentAlignmentCmBxTxBl As String
Get
Return DirectCast(GetValue(VerticalContentAlignmentCmBxTxBlProperty), String)
End Get
Set(ByVal value As String)
SetValue(VerticalContentAlignmentCmBxTxBlProperty, value)
End Set
End Property
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ALTEZZA COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Proprietà che permette di impostare l'altezza della TitleBar
Public Shared ReadOnly HeightCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(HeightCmBxTxBl),
GetType(String),
GetType(ComboParamV),
New FrameworkPropertyMetadata("Auto", FrameworkPropertyMetadataOptions.[Inherits]))
' Declare a get accessor method.
Public Shared Function GetHeightCmBxTxBl(element As ComboParamV) As String
Return DirectCast(element.GetValue(HeightCmBxTxBlProperty), String)
End Function
' Declare a set accessor method.
Public Shared Sub SetHeightCmBxTxBl(element As ComboParamV, value As String)
element.SetValue(HeightCmBxTxBlProperty, value)
End Sub
Public Property HeightCmBxTxBl As String
Get
Return DirectCast(GetValue(HeightCmBxTxBlProperty), String)
End Get
Set(ByVal value As String)
SetValue(HeightCmBxTxBlProperty, value)
End Set
End Property
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~LUNGHEZZA COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Proprietà che permette di impostare l'altezza della TitleBar
Public Shared ReadOnly WidthCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(WidthCmBxTxBl),
GetType(String),
GetType(ComboParamV),
New FrameworkPropertyMetadata("Auto", FrameworkPropertyMetadataOptions.[Inherits]))
' Declare a get accessor method.
Public Shared Function GetWidthCmBxTxBl(element As ComboParamV) As String
Return DirectCast(element.GetValue(WidthCmBxTxBlProperty), String)
End Function
' Declare a set accessor method.
Public Shared Sub SetWidthCmBxTxBl(element As ComboParamV, value As String)
element.SetValue(WidthCmBxTxBlProperty, value)
End Sub
Public Property WidthCmBxTxBl As String
Get
Return DirectCast(GetValue(WidthCmBxTxBlProperty), String)
End Get
Set(ByVal value As String)
SetValue(WidthCmBxTxBlProperty, value)
End Set
End Property
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~GESTIONE FOREGROUND TEXTBOX COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Shared ReadOnly ForegroundTextBoxCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(ForegroundTextBoxCmBxTxBl),
GetType(Brush),
GetType(ComboParamV),
New FrameworkPropertyMetadata(SystemColors.WindowTextBrush, New PropertyChangedCallback(AddressOf ForegroundTextBoxCmBxTxBl_PropertyChanged)) With {.BindsTwoWayByDefault = True})
' Declare a get accessor method.
Public Shared Function GetForegroundTextBoxCmBxTxBl(element As ComboParamV) As Brush
Return DirectCast(element.GetValue(ForegroundCmBxTxBlProperty), Brush)
End Function
' Declare a set accessor method.
Public Shared Sub SetForegroundTextBoxCmBxTxBl(element As ComboParamV, value As Brush)
element.SetValue(ForegroundCmBxTxBlProperty, value)
End Sub
' Declare public property.
Public Property ForegroundTextBoxCmBxTxBl As Brush
Get
Return CType(GetValue(ForegroundTextBoxCmBxTxBlProperty), Brush)
End Get
Set(value As Brush)
SetValue(ForegroundTextBoxCmBxTxBlProperty, value)
End Set
End Property
' Declare method invoke by changing property.
Private Shared Sub ForegroundTextBoxCmBxTxBl_PropertyChanged(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim TempMe As ComboParamV = DirectCast(sender, ComboParamV)
End Sub
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~GESTIONE BACKGROUNDCOLORLIST COMBOBOX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Shared ReadOnly BackgroundListCmBxTxBlProperty As DependencyProperty = DependencyProperty.RegisterAttached(
NameOf(BackgroundListCmBxTxBl),
GetType(Brush),
GetType(ComboParamV),
New FrameworkPropertyMetadata(DirectCast(New BrushConverter().ConvertFromString("#FFFFFF"), Brush),
New PropertyChangedCallback(AddressOf BackgroundListCmBxTxBl_PropertyChanged)) With {.BindsTwoWayByDefault = True})
' Declare a get accessor method.
Public Shared Function GetBackgroundListCmBxTxBl(element As ComboParamV) As Brush
Return DirectCast(element.GetValue(BackgroundListCmBxTxBlProperty), Brush)
End Function
' Declare a set accessor method.
Public Shared Sub SetBackgroundListCmBxTxBl(element As ComboParamV, value As Brush)
element.SetValue(BackgroundListCmBxTxBlProperty, value)
End Sub
' Declare public property.
Public Property BackgroundListCmBxTxBl As Brush
Get
Return CType(GetValue(BackgroundListCmBxTxBlProperty), Brush)
End Get
Set(value As Brush)
SetValue(BackgroundListCmBxTxBlProperty, value)
End Set
End Property
' Declare method invoke by changing property.
Private Shared Sub BackgroundListCmBxTxBl_PropertyChanged(sender As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim TempMe As ComboParamV = DirectCast(sender, ComboParamV)
End Sub
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#End Region ' ComboBox Manage Page
End Class