public MainPage() { this.InitializeComponent(); MainPageDispatcher = Window.Current.Dispatcher; UpdateBoardInfo(); UpdateNetworkInfo(); UpdateDateTime(); UpdateConnectedDevices(); NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged; timer = new DispatcherTimer(); timer.Tick += timer_Tick; timer.Interval = TimeSpan.FromSeconds(30); timer.Start(); OnboardingService = new OnboardingService(); }
public MainPage() { this.InitializeComponent(); // This is a static public property that allows downstream pages to get a handle to the MainPage instance // in order to call methods that are in this class. Current = this; MainPageDispatcher = Window.Current.Dispatcher; NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged; OnboardingService = new OnboardingService(); this.NavigationCacheMode = NavigationCacheMode.Enabled; this.DataContext = LanguageManager.GetInstance(); this.Loaded += (sender, e) => { UpdateBoardInfo(); UpdateNetworkInfo(); UpdateDateTime(); UpdateConnectedDevices(); timer = new DispatcherTimer(); timer.Tick += timer_Tick; timer.Interval = TimeSpan.FromSeconds(30); timer.Start(); }; this.Unloaded += (sender, e) => { timer.Stop(); timer = null; }; }