exposing costituent control property


Aug 13, 2021
Programming Experience
I have a usercontrol(UCGraph2d) which contains a canvas colled pbxWork. I need to read the size from another class, so I tryed to expose like I've made before in the past, but the proprerty is not accessible. It's the first time that I target .net core, could be the iusse related?
here some code:
Public Class UCGraph2d

    Public Property pbxHeight As Integer


            Return (pbxWork.ActualHeight)

        End Get

        Set(ByVal value As Integer)

            pbxWork.Height = value

        End Set

    End Property

End Class

Public Class VisualHost

    Inherits FrameworkElement

    Dim Visual As New DrawingVisual()
'other stuff here'
End Class
I placed the control UCGraph2d in the main window and named it myC, and tryed to access from a second class named "myobj", but not work. If I declare the control by code behind instead like :
Dim myC as new UCGraph2d, it work. Anyone can explain me way? I also tryed to add to xaml x:FieldModifier="public" but nothing change.
Last edited:
Top Bottom