protected override void OnNavigatedTo(NavigationEventArgs e) { // var dt = DateTime.Now.TimeOfDay.TotalMilliseconds; // var language = await CharacterRecognizeModel.InitLanguage(); // System.Diagnostics.Debug.WriteLine((DateTime.Now.TimeOfDay.TotalMilliseconds - dt).ToString()); // ocrEngine = new OcrEngine(language); // Debug.WriteLine(language.ToString()); // Frame frame = Window.Current.Content as Frame; // SuspensionManager.RegisterFrame(ScenarioFrame, "scenarioFrame"); // Định nghĩa lại Back Button //HardwareButtons.BackPressed +=HardwareButtons_BackPressed; if (ScenarioFrame.Content == null) { // When the navigation stack isn't restored navigate to the ScenarioList if (!ScenarioFrame.Navigate(typeof(ScenarioList))) { throw new Exception("Failed to create scenario list"); } } CharacterRecognizeModel.Clear(); if (wtndection.IsEnabled == false) { wtndection.IsEnabled = true; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { CharacterRecognizeModel.Clear(); // quay về home không cho nó quay lại frame trước nữa Frame.BackStack.Clear(); if (imageView.Source == null) { regcognizeBtn.IsEnabled = false; cropBtn.IsEnabled = false; } else { regcognizeBtn.IsEnabled = true; cropBtn.IsEnabled = true; } }