private void Application_Startup(object sender, StartupEventArgs e) { if ((e.InitParams != null) && (e.InitParams.ContainsKey("BaseServiceUrl"))) { Resources.Add("BaseServiceUrl", e.InitParams["BaseServiceUrl"]); } ApplicationIdCredentialsProvider credentialsProvider = new ApplicationIdCredentialsProvider(); if ((e.InitParams != null) && (e.InitParams.ContainsKey("BingMapsKey"))) { credentialsProvider.ApplicationId = e.InitParams["BingMapsKey"]; } this.Credentials = credentialsProvider; this.RootVisual = new MasterLayoutControl(); //Set default system settings if no settings exist. ProxyClient.SetDefaultSystemSettings(false); }
void ButtonClear_Click(object sender, RoutedEventArgs e) { Storyboard sb = new Storyboard(); sb = Application.Current.Resources["ButtonPressAnimation"] as Storyboard; sb.Completed += new EventHandler(delegate(object obj, EventArgs es) { sb.Stop(); }); Storyboard.SetTarget(sb, ButtonClearTransform); sb.Begin(); //Load Default Settings. ProxyClient.SetDefaultSystemSettings(true); LoadSettingsFromIsolatedStorage(); SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Successfully Restored Default System Settings", SystemMessage = string.Empty, UserMessageType = MessageType.Success }, ButtonType.OkOnly); sm.ShowPopup(); }