Binding property to Textbox not working. No errors showing on VS. WPF

Viewed 48

I'm trying to display a value on a textbox. VS is not showing any error, and compilation is working, but the value is not appearing on the Window.

I set the datacontext in the canvas space:

<Canvas Height="450" Width="600" DataContext="{Binding run1}" > 

And the binding like this:

<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding Path=InputData.supportInput.f64SupportLegRearLeft, StringFormat={}{##.##}}" VerticalAlignment="Center" Foreground="#FFFFCD00" FontWeight="Bold" FontSize="18" Grid.Row="3" Grid.Column="3"/>

run1 is an object created on the code behind, that calls a class:

public partial class SupportWindow : Window 
    {

        public ISCcall run1;

        public SupportWindow()
        {
      

            run1 = new ISCcall();
            run1.main();

            InitializeComponent();
        }

The main() in ISCCall fill up the values of this data on the respective structs. The final struct that contains the info is declared like:

        public struct iSC_SupportInput
        {
            public TFloat64 f64SupportLegFrontLeft;
            public TFloat64 f64SupportLegFrontRight;
            public TFloat64 f64SupportLegFrontLeftAngle;
            public TFloat64 f64SupportLegFrontRightAngle;
            public TFloat64 f64SupportLegRearLeft;
.
.
.

TFloat64 is defined like the following:

using TFloat64 = System.Double;

My problem is that on the grid where the textbox is located, the value is not appearing, and I'm not getting any error in the binding, and the value is being set on the property, because I tested printing the value on the console and is working perfectly.

I appreciate your help!

0 Answers
Related