Wpf - Xaml : Binding a list of TextBox in a List of String to Source
<p>I want to create a list of TextBox in binding with <code>ObservableCollection&lt;String&gt;</code> in a ViewModel but i have a problem. The binding <strong>performs only by source to dialog</strong> but it <strong>not works by dialog to source</strong></p>

<p>in my ViewModel i have</p>

<pre><code>   private ObservableCollection&lt;String&gt; _ListSashDim;

    public ObservableCollection&lt;String&gt; ListSashDim
    {
        get { return _ListSashDim; }
        set {
            if (_ListSashDim != value)
            {
                _ListSashDim = value;
                this.RaisePropertyChanged("ListSashDim");
            }
        }

    }
</code></pre>

<p>the list is initialized as below</p>

<pre><code>  private ObservableCollection&lt;string&gt; createListSashPosition(int numAnte)
    {
        ObservableCollection&lt;string&gt; ls = new ObservableCollection&lt;string&gt;();
        for (int i = 0; i &lt; numAnte; i++)
        {
            ls.Add("X");
        }

        return ls;
    }
</code></pre>

<p>in my Xaml i have a DataTemplate</p>

<pre><code> &lt;!--#region DataTemplate ListSashDim--&gt;
    &lt;DataTemplate x:Key="DataTemplateSashDim"&gt;
        &lt;ItemsControl&gt;
            &lt;StackPanel Orientation="Vertical" Width="116" HorizontalAlignment="Center" VerticalAlignment="Center"&gt;
                &lt;TextBlock FontSize="10" HorizontalAlignment="Center" Text="Sash Dim"&gt;&lt;/TextBlock&gt;
                &lt;TextBox x:Name="tbSashDim" Width="90" Text="{Binding Path=.,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" &gt;&lt;/TextBox&gt;
            &lt;/StackPanel&gt;
        &lt;/ItemsControl&gt;
    &lt;/DataTemplate&gt;
    &lt;!--#endregion--&gt;
</code></pre>

<p>and an ItemsControl in a StackPanel</p>

<pre><code>&lt;StackPanel   
                Orientation="Horizontal" 
                HorizontalAlignment="Center" 
                VerticalAlignment="Center" FlowDirection="LeftToRight"
                  Margin="0,10,0,0"&gt;

                &lt;ItemsControl ItemsSource="{Binding ListSashDim, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" 
                              HorizontalAlignment="Center" 
                              VerticalAlignment="Center" 
                              Margin="0" ItemTemplate="{DynamicResource DataTemplateSashDim}" Padding="8" &gt;
                    &lt;ItemsControl.ItemsPanel&gt;
                        &lt;ItemsPanelTemplate&gt;
                            &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Center"&gt;&lt;/StackPanel&gt;
                        &lt;/ItemsPanelTemplate&gt;
                    &lt;/ItemsControl.ItemsPanel&gt;
                &lt;/ItemsControl&gt;
            &lt;/StackPanel&gt;
</code></pre>

<p>Thanks so much
Manuel </p>