title: Generate textbox into grid from a string
body: <p>I would like to generate text boxes inside a gridview. Each of the text box contains a char from the string (this string is obtain from the text box Text Changed event handler).</p>
  
  <pre><code>Example:
  string = hello,
  I would like to generate 5 textboxes, each contains "h", "e", "l", "l", "o".
  </code></pre>
  
  <p>I have implemented the application myself, but i run into performance issues, the application is very laggy when the string length is > 30 chars (when i type inside the textbox, the textbox generates much slower than my input, besides my input is delay before it appears in the text box)</p>
  
  <p>May I know how can I improve this problem? (i am quite sure, with today PC, this should not be a performance problem...)</p>
  
  <p>Code:</p>
  
  <pre><code> // main.cs
   private ObservableCollection&lt;MenuSettings&gt; gridCollection;
  
          public MainPage()
          {
              this.InitializeComponent();
              this.gridCollection = new ObservableCollection&lt;MenuSettings&gt;();
  
              gridView.ItemsSource = this.gridCollection;            
          }
  
          private void textBox_name_TextChanged(object sender, TextChangedEventArgs e)
          {
              var collections = MenuSettings.Convert(textBox_name.Text);
              int gridCollectionLength = this.gridCollection.Count;
              int diff = collections.Count - gridCollectionLength;
  
              for (int i = 0; i &lt; Math.Abs(diff); i++) {
                  if (diff &gt; 0) {
                      this.gridCollection.Add(new MenuSettings());
                  } else {
                      this.gridCollection.RemoveAt(gridCollectionLength - i - 1);
                  }
              }
  
              for (int i = 0; i &lt; this.gridCollection.Count; i++) {
                  this.gridCollection[i] = collections[i];
              }
          }
  
  // menusetting.cs
   public class MenuSettings
      {
          private SolidColorBrush selected;
  
          public string Title { set; get; }
          public SolidColorBrush Selected { set; get; }
  
  
          public static List&lt;MenuSettings&gt; Convert(string text)
          {
              return text.ToCharArray().Select((x, i) =&gt; {
                  return new MenuSettings()
                  {
                      Title = x.ToString()
                  };
              }).ToList();
          }
      }
  
  
  &lt;TextBox x:Name="textBox_name" Text="hello! this is so cool!"
                   TextChanged="textBox_name_TextChanged"
                   SelectionChanged="textBox_name_SelectionChanged" /&gt;
          &lt;GridView x:Name="gridView"&gt;
              &lt;GridView.ItemTemplate&gt;
                  &lt;DataTemplate x:DataType="local:MenuSettings"&gt;
                      &lt;TextBox Text="{x:Bind Title}"
                               Background="{x:Bind Selected}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/GridView.ItemTemplate&gt;
          &lt;/GridView&gt;
  </code></pre>