private void WeatherPeekContent_Unloaded(object sender, RoutedEventArgs e) { LoadedWeatherPeekContents.Remove(this); updateTimer.Tick -= updateTimer_Tick; updateTimer.Stop(); updateTimer = null; }
private void WeatherPeekContent_Loaded(object sender, RoutedEventArgs e) { LoadedWeatherPeekContents.Add(this); string[] split = Settings.WeatherHome.Split(','); location.Text = split[0]; tempUnit.Text = Settings.WeatherMetric ? "°C" : "°F"; updateTimer = new DispatcherTimer(); updateTimer.Interval = TimeSpan.FromMinutes(10); updateTimer.Tick += updateTimer_Tick; }