'how to bind textblock Text property in one of the view (XAML) to a string Property of different view model in C# wpf

    >>Sample View model
    
     public class TestViewModel 
        {
        public string XMLInfoEnabledText { get; set; }
        }
    
  >>My GDetails.Xaml 
    <Grid>
    <stackpanel>
    <TextBlock Text="{Binding XMLInfoEnabledText }" Foreground="{Binding ErrorColor}" Style="{DynamicResource Global_TextBlock}" Margin="5" Visibility="{Binding  IsParametersEnabled, Converter={StaticResource IbtoVConv}}"/>
    </Grid>
    </stackpanel>


    
  • I have tried the above way. But its not working >>any help is appreciated. >>Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source