I've created my own socket class and an instance of it in MainWindow.xaml.cs, and I want to create a small little TextBlock to monitor the connection status. I've been using this specific link: WPF textblock binding in XAML
Here's the code attempt. ComUplink.cs:
public class ComUplink { public String ConnectionStatus = "Idle"; public Socket Socklink; } In MainWindow.xaml.cs:
public partial class MainWindow : Window { ComUpLink Uplink; ... public void Login_Click(object Sender, RoutedEventArgs e) { Uplink = new ComUpLink(); } } AND in the XAML file:
<TextBlock x:Name="textBlock3" TextAlignment="Right" HorizontalAlignment="Left" Margin="12,218,0,0" TextWrapping="Wrap" Text="{Binding Path=Uplink.ConnectionString}" VerticalAlignment="Top" Foreground="#616161" Width="236"/> So, my question is, why isn't this binding properly? Am I missing an implementation of INotifyPropertyChanged?