Bindings need to be done in XAML.
Initially, you need to bind the ViewModel to the DataContext of your window.
Example:
using System.Windows; using WpfApplication.View; using WpfApplication.ViewModel; namespace WpfApplication { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { public App() { var mw = new MainWindowView { DataContext = new MainViewModel() }; mw.Show(); } } }
MainWindowView is your window. MainViewModel - a class that implements the connection of the window with the model. In MainViewModel you create an instance of your model MyModel model = new MyModel() , and in the class MyModel you have your year variable, it is necessary that it be accessible, for example, through the public int Year {get { return year;}...} property. Then in the XAML code you need to bind via Binding :
<TextBox Name="tb" TextWrapping="Wrap" Text="{Binding Path=Model.Year}" VerticalAlignment="Top" />
Here is a very good article about MVVM for beginners: http://svyatoslavpankratov.blogspot.ru/2011/11/mvvm-pattern-1.html