示例#1
0
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
            using (DictionaryModel db = new DictionaryModel())
            {
                if (!db.DatabaseExists())
                    throw new Exception("Database not found");
            }
            viewModel = new VocabularyViewModel();

            // Query the local database and load observable collections.
            viewModel.LoadCollectionsFromDatabase();
        }
 public VocabularyView()
 {
     InitializeComponent();
     viewModel = new VocabularyViewModel();
     viewModel.LoadCollectionsFromDatabase();
 }