//private Accelerometer _accelerometer; // Constructor public MainPage() { InitializeComponent(); _appSettings = new AppSettings(); _timer = new DispatcherTimer(); _battery = new Battery(); //_accelerometer = new Accelerometer(); _animatedGifs = new AnimatedGifs(); _scheduledBackgroundAgent = new ScheduledBackgroundAgent(); _scaleFactor = (float)Application.Current.Host.Content.ScaleFactor / 100; _viewportHeight = (int)(Application.Current.Host.Content.ActualHeight * _scaleFactor); _viewportWidth = (int)(Application.Current.Host.Content.ActualWidth * _scaleFactor); ImagePanel.Height = _viewportHeight; BackgroundImage.Height = _viewportHeight; ImagePanelTemp.Height = _viewportHeight; BackgroundImageTemp.Height = _viewportHeight; _photos = new Photos { ViewportHeight = _viewportHeight, ViewportWidth = _viewportWidth }; var phoneAppService = PhoneApplicationService.Current; phoneAppService.UserIdleDetectionMode = IdleDetectionMode.Disabled; // Update every second for items that change frequently _timer.Interval = new TimeSpan(0, 0, 0, 1); _timer.Tick += TimerTick; }
// Constructor public MainPage() { InitializeComponent(); _backgroundAgent = new ScheduledBackgroundAgent(); var timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(5); timer.Tick += timer_Tick; timer.Start(); }
public SettingsPano() { InitializeComponent(); SetAboutText(); _photoChooserTask = new PhotoChooserTask(); _backgroundAgent = new ScheduledBackgroundAgent(); _appSettings = new AppSettings(); _photos = new Photos(); // Need to set this up here as when the chooser opens we navigate away _photoChooserTask.Completed += PhotoChooserTaskCompleted; var savedImage = _photos.LoadBackgroundImage(); if (savedImage != null) { CurrentBackground.Source = savedImage; } }