Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

[VB] Attached Property and Design time attribute

$
0
0

Hello,

I've created a class WindowEX to extend the capabilities of System.Windows.window (adding new behaviors, properties...) in which I declared the attached property as below (VB):

Public Class WindowEX
    Public Shared Function GetKeepSize(ByVal element As DependencyObject) As Boolean
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return CBool(element.GetValue(KeepSizeProperty))
    End Function

    Public Shared Sub SetKeepSize(ByVal element As DependencyObject, ByVal value As Boolean)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(KeepSizeProperty, value)
    End Sub

    <System.ComponentModel.Category("IHM")> _
    Public Shared ReadOnly KeepSizeProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("KeepSize", _
                           GetType(Boolean), GetType(System.Windows.Window), _
                           New UIPropertyMetadata(False))


End Class

I want this property to be displayed into the pane property of VS, but it doesn't, in spite of the attribute:

<System.ComponentModel.Category("IHM")> _


I can't understand why...

Where am I wrong ?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>