The MainWindow xaml
has an named outer grid View
.
The xaml code behind (MainWindow.xaml.cs
) may only contain a constructor
which sets the View.DataContext
to an instance of a new ViewModel
class.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
View.DataContext = new ViewModel();
}
}
Use xaml and additional code / classes to implement the bindings to implement
the following behavior.
MainWindow user interface contains :
two input textboxes A and B (with Width=100 and Height=25).
two result textboxes containing : C = A + B, and D = A * B, these update, when A or B change.
MainWindow background color is:
LightBlue when mouse cursor enters A inputbox
LightGreen when mouse cursor enters B inputbox
LightGray all other cases.