// Constructor public MainPage() { InitializeComponent(); LogsModel = new Logs(); MainPageModel = new MainPageModel(); _notifServerApi = App.NotifServerApi; SetNotificationEnabled(false); UiStateToStopped(true); // DataContexts this.ActivitySlider.DataContext = CameraViewfinder.CameraData; this.ActivitySlider.Style = Application.Current.Resources["CustomSliderStyle_Yellow"] as Style; this.CameraTresholdSlider.DataContext = CameraViewfinder.CameraData; // Custom screensaver _screensaverControl = new ScreenSaver(this.LayoutRoot, this.ApplicationBar); // Read Ovi accout id from isolated storage string usernameFromStore; if (ReadUsername(out usernameFromStore)) { MainPageModel.OviAccountId = usernameFromStore; } // Load sounds StreamResourceInfo alarmStream = Application.GetResourceStream( new Uri("SoundFiles/26173__wim__sirene-06080401.wav", UriKind.RelativeOrAbsolute)); _alarmSound = SoundEffect.FromStream(alarmStream.Stream); StreamResourceInfo waitAlarmSound = Application.GetResourceStream( new Uri("SoundFiles/31841__hardpcm__chip001.wav", UriKind.RelativeOrAbsolute)); _waitAlarmSound = SoundEffect.FromStream(waitAlarmSound.Stream); StreamResourceInfo radioStream = Application.GetResourceStream( new Uri("SoundFiles/30335__erh__radio-noise-2.wav", UriKind.RelativeOrAbsolute)); _radioSound = SoundEffect.FromStream(radioStream.Stream); StreamResourceInfo radioStream2 = Application.GetResourceStream( new Uri("SoundFiles/30623__erh__do-it-now-2.wav", UriKind.RelativeOrAbsolute)); _radioSound2 = SoundEffect.FromStream(radioStream2.Stream); StreamResourceInfo radioStream3 = Application.GetResourceStream( new Uri("SoundFiles/27878__inequation__walkietalkie-eot.wav", UriKind.RelativeOrAbsolute)); _radioSound3 = SoundEffect.FromStream(radioStream3.Stream); StreamResourceInfo radioStream4 = Application.GetResourceStream( new Uri("SoundFiles/34383__erh__walk-away.wav", UriKind.RelativeOrAbsolute)); _radioSound4 = SoundEffect.FromStream(radioStream4.Stream); }
// Constructor public MainPage() { InitializeComponent(); LogsModel = new Logs(); MainPageModel = new MainPageModel(); _notifServerApi = App.NotifServerApi; SetNotificationEnabled(false); UiStateToStopped(true); // DataContexts this.ActivitySlider.DataContext = CameraViewfinder.CameraData; this.ActivitySlider.Style = Application.Current.Resources["CustomSliderStyle_Yellow"] as Style; this.CameraTresholdSlider.DataContext = CameraViewfinder.CameraData; // Custom screensaver _screensaverControl = new ScreenSaver(this.LayoutRoot, this.ApplicationBar); // Read Ovi accout id from isolated storage string usernameFromStore; if (ReadUsername(out usernameFromStore)) MainPageModel.OviAccountId = usernameFromStore; // Load sounds StreamResourceInfo alarmStream = Application.GetResourceStream( new Uri("SoundFiles/26173__wim__sirene-06080401.wav", UriKind.RelativeOrAbsolute)); _alarmSound = SoundEffect.FromStream(alarmStream.Stream); StreamResourceInfo waitAlarmSound = Application.GetResourceStream( new Uri("SoundFiles/31841__hardpcm__chip001.wav", UriKind.RelativeOrAbsolute)); _waitAlarmSound = SoundEffect.FromStream(waitAlarmSound.Stream); StreamResourceInfo radioStream = Application.GetResourceStream( new Uri("SoundFiles/30335__erh__radio-noise-2.wav", UriKind.RelativeOrAbsolute)); _radioSound = SoundEffect.FromStream(radioStream.Stream); StreamResourceInfo radioStream2 = Application.GetResourceStream( new Uri("SoundFiles/30623__erh__do-it-now-2.wav", UriKind.RelativeOrAbsolute)); _radioSound2 = SoundEffect.FromStream(radioStream2.Stream); StreamResourceInfo radioStream3 = Application.GetResourceStream( new Uri("SoundFiles/27878__inequation__walkietalkie-eot.wav", UriKind.RelativeOrAbsolute)); _radioSound3 = SoundEffect.FromStream(radioStream3.Stream); StreamResourceInfo radioStream4 = Application.GetResourceStream( new Uri("SoundFiles/34383__erh__walk-away.wav", UriKind.RelativeOrAbsolute)); _radioSound4 = SoundEffect.FromStream(radioStream4.Stream); }
/// <summary> /// Constructor for the Application object. /// </summary> public App() { // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Nokia Notifications API handler NotifServerApi = new NotifServerApi(); // Standard Silverlight initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); // Disable idle mode for to allow camera to run all the time PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; }
/// <summary> /// Constructor for the Application object. /// </summary> public App() { // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Nokia Notifications API handler NotifServerApi = new NotifServerApi(); // Standard Silverlight initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); // Disable idle mode for to allow camera to run all the time PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; }