© 2026 Hedgehog Software, LLC
public class MainViewModel : ViewModelBase { private ViewModelBase _currentChildView; private string _title; public ViewModelBase CurrentChildView { get { return _currentChildView; } set { _currentChildView = value; OnPropertyChanged(nameof(CurrentChildView)); } } public string Title { get => _title; set { _title = value; OnPropertyChanged(nameof(Title)); } } // Commands for user interactions public ICommand ShowBloodPressureViewCommand { get; } public ICommand ShowBMIViewCommand { get; } public ICommand ShowHeightWeightViewCommand { get; } public MainViewModel() { ShowBloodPressureViewCommand = new RelayCommand(ExecuteShowBloodPressureViewCommand); ShowBMIViewCommand = new RelayCommand(ExecuteShowBMIViewCommand); ShowHeightWeightViewCommand = new RelayCommand(ExecuteShowHeightWeightViewCommand); ExecuteShowBloodPressureViewCommand(null); } private void ExecuteShowHeightWeightViewCommand(object obj) { CurrentChildView = new HeightWeightViewModel(); Title = "Height Weight"; } private void ExecuteShowBMIViewCommand(object obj) { CurrentChildView = new BMIViewModel(); Title = "BMI"; } private void ExecuteShowBloodPressureViewCommand(object obj) { CurrentChildView = new BloodPressureViewModel(); Title = "Blood Pressure"; } }
ExecuteShowBloodPressureViewCommand