I'm trying to display in XAML a value of a property of a class contained in "Call.cs".
public class call{
.
.
1InputData InputData = 1InputData.Default();
public void main(){
InputData.X.A[0]=99;
}
I put in main.cs:
var run1 = new Call();
run1.main();
var show = new Binding("run");
show.Mode = BindingMode.OneWay;
show.Source = run1;
And in my XAML:
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding run1.InputData.A.B[0]}" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2"/>
But the context is not being recognized. I dont want to set a DataContext for the full WPF Window, because I will need to access to more than one origin to bind data.
The window that will display this Data is a secondary window called from a button in main window. (Just saying in case this is relevant).
There is a way to do it?
Thank you!