exposing costituent control property

Damien.darhk

Member
Joined
Aug 13, 2021
Messages
9
Programming Experience
3-5
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:
VB.NET:
Public Class UCGraph2d


    Public Property pbxHeight As Integer

        Get

            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:
Back
Top