Databinding with unnamed textboxes and listbox
<p>I have been taught lately when using WPF and databinding it is good practice to not name any of the fields but only to associate them with the properties in the other classes.  My problem right now is how do I add the data from 3 textboxes (the user enters), save the binded information to the model which then posts the account information into the listbox on the side.  I need to add the data to my model. My code from main.xaml is below:</p>

<pre><code>    &lt;ListBox ItemsSource="{Binding Path=Files}" SelectedItem="{BindingPath=CurrentItem}" /&gt;

   &lt;TextBox Text="{Binding Path=bankaccount}"/&gt;
   &lt;TextBox Text="{Binding Path=accountnumber}"/&gt;
   &lt;TextBox Text="{Binding Path=accounttype}"/&gt;
   &lt;Button Content="Save Data To Listbox" Click="Save_Click"/&gt;
</code></pre>

<p>Now I will show my FileModel class which holds all of my properties which will be from the textboxes</p>

<pre><code>        private short _BankAccount;
        private long _AccountNumber;
        private char _AccountType;

        public short bankaccount{ get { return _BankAccount;} set  {_BankAccount= value;    Notify("bankaccount"); } }
        public long accountnumber{ get { return _AccountNumber;} set {_AccountNumber= value; Notify("accountnumber"); } }
        public char accounttype{ get { return _AccountType;} set{_AccountType= value; Notify("accounttype"); } }
</code></pre>

<p>I use a class called ProgramModel As my middle point between the Mainpage and my FileModel page and here is that code:</p>

<pre><code> public class ProgramModel : INotifyPropertyChanged
{

    public ObservableCollection&lt;FileModel&gt; Files { get; set; }

    private FileModel _currentItem;
    public FileModel CurrentItem { get { return _currentItem; } set { _currentItem = value; Notify("CurrentItem"); } }


    public ProgramModel()
    {
        Files = new ObservableCollection&lt;FileModel&gt;();
    }
</code></pre>

<p>And to finish it off I have my mainpage:</p>

<pre><code>  internal partial class MainWindow
{

    public ProgramModel Model { get; set; }

    private ViewSettings _viewSettings = new ViewSettings();


    public MainWindow()
    {
        InitializeComponent();

        this.DataContext = Model = new ProgramModel();

        }

    private void Save_Click(object sender, RoutedEventArgs e)
    {
        FileModel filemodel = new FileModel();

        Model.Files.Add(new FileModel( filemodel.bankaccount, filemodel.accountnumber, filemodel.accounttype));
    }
</code></pre>

<p>I feel like I am adding to the Files Collection incorrectly from the save button event. If you guys can help me out that would be great! All 3 textboxes and the listbox are on the Main page.  Let me know if you have any questions.  Also, this is a learning experience so let me know if I posted too much code or not enough.  Thanks!</p>