private void Initialize(PowerStatusType powerStatus) { switch (powerStatus) { case PowerStatusType.Sleep: StatusText = "Entering sleep mode"; SvgPath = "TouchPanel.Icons.moon_stars_white.svg"; break; case PowerStatusType.Restart: StatusText = "Restarting panel"; SvgPath = "TouchPanel.Icons.undo_white.svg"; break; case PowerStatusType.Shutdown: StatusText = "Shutting down"; SvgPath = "TouchPanel.Icons.power_off_white.svg"; break; } }
public PowerStatusPage(PowerStatusType powerStatus) { InitializeComponent(); BindingContext = new PowerStatusViewModel(powerStatus); }
public PowerStatusViewModel(PowerStatusType powerStatus) { Initialize(powerStatus); }