I have this small data class in C#
public class ApiSettings
{
public string ApiKey { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Path { get; set; }
}
And I have this TextBox in my WPF as defined in xaml:
<Grid Margin="0,10,0,0" Name="pnl_api">
<Label Style="{StaticResource SettingsTitleLabelStyle}" Content="Remote Server Credentials" Margin="20,-2,0,0" />
<Label Content="API Key" Margin="45,36,0,0" FontSize="12.07" />
<TextBox x:Name="tb_api_key" Style="{StaticResource RoundTextBoxStyle}" Text="{Binding ApiKey}"
Margin="106,30,0,0" Width="200" TextChanged="tb_server_TextChanged" />
<Label Content="User" Margin="64,69,0,0" FontSize="12.07" />
<TextBox x:Name="tb_api_user" Style="{StaticResource RoundTextBoxStyle}" Margin="106,62,0,0"
Text="{Binding Username}" Width="200" TextChanged="tb_server_TextChanged" />
<Label Content="Password" Margin="36,100,0,0" FontSize="12.07" />
<PasswordBox x:Name="tb_api_password" Style="{StaticResource RoundPasswordBoxStyle}" Margin="106,94,0,0" Width="200" />
<Label Content="Path" Margin="64,134,0,0" FontSize="12.07" />
<TextBox x:Name="tb_api_path" Style="{StaticResource RoundTextBoxStyle}"
Text="{Binding Path}" Margin="106,127,0,0" Width="200" />
</Grid>
The problem here is all other bound TextBox’s and PasswordBox are working except the tb_api_path
<TextBox x:Name="tb_api_path" Style="{StaticResource RoundTextBoxStyle}" Text="{Binding Path}" Margin="106,127,0,0" Width="200" />
The crazy thing is this TextBox’s are all defined the same way, i tried changing the name, the property and always the same thing, the binding for the last TextBox in the list doesn’t work at all.
Any help please?