protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); SetSizeTextBlockText(_size); if (_taskResult != null) { if (_taskResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK) { System.Diagnostics.Debug.WriteLine("Code read successfully"); var byteCount = _taskResult.Data != null ? _taskResult.Data.Length : 0; TypeTextBlock.Text = String.Format("{0} ({1} bytes)", _taskResult.Format, byteCount); DescriptionTextBlock.Text = _taskResult.Text; ThumbnailImage.Source = _taskResult.Thumbnail; } else { System.Diagnostics.Debug.WriteLine("Code reading aborted"); } _taskResult = null; } ResultStackPanel.Visibility = ThumbnailImage.Source != null ? Visibility.Visible : Visibility.Collapsed; GuideStackPanel.Visibility = ThumbnailImage.Source == null ? Visibility.Visible : Visibility.Collapsed; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); SetSizeTextBlockText(_size); if (_taskResult != null) { if (_taskResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK) { System.Diagnostics.Debug.WriteLine("Code read successfully"); var byteCount = _taskResult.Data != null ? _taskResult.Data.Length : 0; TypeTextBlock.Text = String.Format("{0} ({1} bytes)", _taskResult.Format, byteCount); DescriptionTextBlock.Text = _taskResult.Text; ThumbnailImage.Source = _taskResult.Thumbnail; } else { System.Diagnostics.Debug.WriteLine("Code reading aborted"); } _taskResult = null; } ResultStackPanel.Visibility = ThumbnailImage.Source != null ? Visibility.Visible : Visibility.Collapsed; GuideStackPanel.Visibility = ThumbnailImage.Source == null ? Visibility.Visible : Visibility.Collapsed; }
private void OpticalReaderTask_Completed(object sender, OpticalReaderLib.OpticalReaderResult e) { _taskResult = e; if (_taskResult.Text != null) { String thing = _taskResult.Text; System.Windows.MessageBox.Show(thing); } }
// Constructor public AddNewGame() { InitializeComponent(); CreateOpticalReaderTask_Singleton(); CreateHttpClient_Singleton(); _opReadResult = null; _opReadTask.Completed += OpticalReaderTask_Completed; _opButtonContext = false; addGameButtonContext = false; // Set the data context of the listbox control to the sample data DataContext = App.ViewModel; pickBackgroundColor(); BuildLocalizedApplicationBar(); }
// Load data for the ViewModel Items protected override async void OnNavigatedTo(NavigationEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); } base.OnNavigatedTo(e); if (_opReadResult != null && _opReadResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK) { SetProgressIndicator(true, ProgressStatus.Searching); await FetchHTMLdata(); SetProgressIndicator(false, ProgressStatus.Searching); } _opReadResult = null; _opButtonContext = false; addGameButtonContext = false; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (_taskResult != null) { if (_taskResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK) { System.Diagnostics.Debug.WriteLine("Code read successfully"); var byteCount = _taskResult.Data != null ? _taskResult.Data.Length : 0; } else { System.Diagnostics.Debug.WriteLine("Code reading aborted"); } _taskResult = null; } ReadCodeButton_Click(); }
private void OpticalReaderTask_Completed(object sender, OpticalReaderLib.OpticalReaderResult e) { _taskResult = e; }
void _task_Completed(object sender, OpticalReaderLib.OpticalReaderResult e) { _taskResult = e; System.Diagnostics.Debug.WriteLine(e.Text); }
private void OpticalReaderTask_Completed(object sender, OpticalReaderLib.OpticalReaderResult e) { _opReadResult = e; }