{"action":"created","issue":{"url":"https://api.github.com/repos/Redth/ZXing.Net.Mobile/issues/765","repository_url":"https://api.github.com/repos/Redth/ZXing.Net.Mobile","labels_url":"https://api.github.com/repos/Redth/ZXing.Net.Mobile/issues/765/labels{/name}","comments_url":"https://api.github.com/repos/Redth/ZXing.Net.Mobile/issues/765/comments","events_url":"https://api.github.com/repos/Redth/ZXing.Net.Mobile/issues/765/events","html_url":"https://github.com/Redth/ZXing.Net.Mobile/issues/765","id":346845131,"node_id":"MDU6SXNzdWUzNDY4NDUxMzE=","number":765,"title":"Show scanned barcode to next page.","user":{"login":"jsicad","id":41644566,"node_id":"MDQ6VXNlcjQxNjQ0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/41644566?v=4","gravatar_id":"","url":"https://api.github.com/users/jsicad","html_url":"https://github.com/jsicad","followers_url":"https://api.github.com/users/jsicad/followers","following_url":"https://api.github.com/users/jsicad/following{/other_user}","gists_url":"https://api.github.com/users/jsicad/gists{/gist_id}","starred_url":"https://api.github.com/users/jsicad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsicad/subscriptions","organizations_url":"https://api.github.com/users/jsicad/orgs","repos_url":"https://api.github.com/users/jsicad/repos","events_url":"https://api.github.com/users/jsicad/events{/privacy}","received_events_url":"https://api.github.com/users/jsicad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-02T03:24:41Z","updated_at":"2018-10-10T18:20:52Z","closed_at":null,"author_association":"NONE","body":"How can I pass the value of result.text to another page instead of displaying on DisplayAlert. Your help is highly appreciated.\r\n\r\nprivate async void ButtonScanDefault_Clicked(object sender, EventArgs e)\r\n{\r\nscanPage = new ZXingScannerPage();\r\nscanPage.OnScanResult += (result) =>\r\n{\r\nscanPage.IsScanning = false;\r\nDevice.BeginInvokeOnMainThread(() =>\r\n{\r\nNavigation.PopModalAsync();\r\nDisplayAlert(\"Scanned Barcode\", result.Text, \"OK\");\r\n});\r\n};\r\nawait Navigation.PushModalAsync(scanPage);\r\n}"},"comment":{"url":"https://api.github.com/repos/Redth/ZXing.Net.Mobile/issues/comments/428678131","html_url":"https://github.com/Redth/ZXing.Net.Mobile/issues/765#issuecomment-428678131","issue_url":"https://api.github.com/repos/Redth/ZXing.Net.Mobile/issues/765","id":428678131,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODY3ODEzMQ==","user":{"login":"zwilkin","id":9438425,"node_id":"MDQ6VXNlcjk0Mzg0MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/9438425?v=4","gravatar_id":"","url":"https://api.github.com/users/zwilkin","html_url":"https://github.com/zwilkin","followers_url":"https://api.github.com/users/zwilkin/followers","following_url":"https://api.github.com/users/zwilkin/following{/other_user}","gists_url":"https://api.github.com/users/zwilkin/gists{/gist_id}","starred_url":"https://api.github.com/users/zwilkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwilkin/subscriptions","organizations_url":"https://api.github.com/users/zwilkin/orgs","repos_url":"https://api.github.com/users/zwilkin/repos","events_url":"https://api.github.com/users/zwilkin/events{/privacy}","received_events_url":"https://api.github.com/users/zwilkin/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T18:20:52Z","updated_at":"2018-10-10T18:20:52Z","author_association":"NONE","body":"@jsicad \r\nAnother option would be to pass the result through a class constructor when initializing navigation to the new page.  Make sure to make your scanning result an `async` method and use proper `await` identifiers so that you can correctly handle navigation.\r\n\r\nFor Example:\r\n'''c#\r\nprivate async void ButtonScanDefault_Clicked(object sender, EventArgs e)\r\n{\r\n    scanPage = new ZXingScannerPage();\r\n    scanPage.OnScanResult += (result) =>\r\n    {\r\n        scanPage.IsScanning = false;\r\n        Device.BeginInvokeOnMainThread(async () =>\r\n        {\r\n            await Navigation.PopModalAsync();    // Dismiss the camera\r\n            await Navigation.PushAsync(new YourNewPage(result));    // Display the new page\r\n        });\r\n    };\r\n    await Navigation.PushModalAsync(scanPage);\r\n}\r\n'''\r\n\r\nCreate a constructor for the new page like this:\r\n'''\r\npublic YourNewPage(ZXing.Result result)\r\n{\r\n    InitializeComponent();\r\n\r\n    // Do what you want with your result - such as assign the text value to a UI label\r\n    // Example:\r\n    barcode_label.Text = result.Text;\r\n}\r\n'''"}}
{"actor":{"display_login":"zwilkin"}}