Note that there are some explanatory texts on larger screens.

plurals
  1. POBinding is not displaying the correct value
    text
    copied!<p>Basically, I am reading a value from an xml file and displaying that value in a text box. This text box is editable so the user can make changes to it and when the session ends that value gets stored back in the xml file.</p> <p>I know that the values correctly get stored and loaded to the text box. But I'm baffled as to why I cannot see the bound value that should be displayed in the text box.. </p> <p>This is the text box:</p> <pre><code>&lt;UserControl x:Class="test.myView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ui="clr-namespace:test.myView" xmlns:local="test.myControls;assembly=test.mycontrols"&gt; &lt;UserControl.Resources&gt; &lt;ResourceDictionary&gt; &lt;ResourceDictionary.MergedDictionaries&gt; &lt;ResourceDictionary Source="Style.xaml"/&gt; &lt;/ResourceDictionary&gt; &lt;/UserControl.Resources&gt; &lt;StackPanel Margin="8"&gt; &lt;TextBlock Text="Starting URL"/&gt; &lt;TextBox Margin="0,5" FontSize="12" Height="30" Width="360" Text="{Binding myValue, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Style="{StaticResource WaterMarkTextBox}" local:WaterMarkTextHelper.WatermarkText="ENTER Value" /&gt; &lt;/StackPanel&gt; </code></pre> <p></p> <p>This is the INotifyPropertyChanged:</p> <pre><code>public abstract class ViewModelBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected void RaiseChangeNotification(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } </code></pre> <p>This is the property im binding to:</p> <pre><code>public string myValue { get { return _settings.myValue; } set { _settings.myValue= value; } } </code></pre> <p>I think it maybe because the value of the text box to empty before the code reaches the part where the start url is set using data binding. Does there exist a validate command in wpf that forces it to view the most up to date value?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload