I want to create a solution where I want to write MVVM program using C# and XAML to perform some simple computations.
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.
Code
public partial class MainWindow : WindowCode
{Code
public MainWindow()Code
{Code
InitializeComponent();Code
Code
View.DataContext = new ViewModel();Code
}Code
}SQL
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.
Sanwar RanwaRank #23 · 44.7K reputationPosted Sep 3, 2018, 3:01 AM EDT