|
using System.Windows;
namespace Example1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
// our view model
SongViewModel _viewModel;
public MainWindow()
{
InitializeComponent();
// We have declared the view model instance declaratively in the xaml.
_viewModel = (SongViewModel)base.DataContext;
}
private void ButtonUpdateArtist_Click(object sender, RoutedEventArgs e)
{
// the gui WILL NOT update.
_viewModel.ArtistName = "Elvis";
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.