Пример #1
0
 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     if (_model == null)
     {
         DataContext = _model = (App.Current as App).Model;
         _model.SearchBeginning += new EventHandler(_model_SearchCompleted);
         _eventWired = true;
     }
 }
Пример #2
0
 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (Model == null)
     {
         Model = new AppViewModel();
         if (PhoneApplicationService.Current.State.ContainsKey("SolutionsState"))
         {
             try
             {
                 var solutions = PhoneApplicationService.Current.State["SolutionsState"] as Word[];
                 foreach (Word w in solutions)
                     Model.Solutions.Add(w);
             }
             catch (Exception)
             {
             }
         }
     }
 }
Пример #3
0
 void WordList_Unloaded(object sender, RoutedEventArgs e)
 {
     DataContext = _model = null;
 }
Пример #4
0
 // Code to execute when the application is launching (eg, from Start)
 // This code will not execute when the application is reactivated
 private void Application_Launching(object sender, LaunchingEventArgs e)
 {
     Model = new AppViewModel();
     Model.Solve();
 }