<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>SilverlightZXing Wiki Rss Feed</title><link>http://silverlightzxing.codeplex.com/</link><description>SilverlightZXing Wiki Rss Description</description><item><title>New Comment on "Documentation"</title><link>http://silverlightzxing.codeplex.com/documentation?&amp;ANCHOR#C25551</link><description>Hi, I&amp;#39;ve been trying to implement this code, but when I call the code it is not waiting for the scan to be completed. It starts the camera, then immediately exits. What is the solution&amp;#63;</description><author>ciaran036</author><pubDate>Sun, 11 Nov 2012 17:20:18 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20121111052018P</guid></item><item><title>New Comment on "Documentation"</title><link>http://silverlightzxing.codeplex.com/documentation?&amp;ANCHOR#C25550</link><description>Hi, I&amp;#39;ve been trying to implement this code, but when I call the code it is not waiting for the scan to be completed. It starts the camera, then immediately exits. What is the solution&amp;#63;</description><author>ciaran036</author><pubDate>Sun, 11 Nov 2012 17:19:59 GMT</pubDate><guid isPermaLink="false">New Comment on "Documentation" 20121111051959P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://silverlightzxing.codeplex.com/documentation?version=4</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;Right now your best bet is to download the latest version of the full source code (&lt;a title="here" href="http://silverlightzxing.codeplex.com/SourceControl/list/changesets#"&gt;here&lt;/a&gt;, see link on right) and start poking around in the WP7Code folder starting
 with the&amp;nbsp;WP7Manager.cs class. You basically set WP7BarcodeManager.ScanMode to your desired scan type and then call&amp;nbsp;ScanBarcode with a callback method. There are three overrides of the ScanBarcode method, one uses the&amp;nbsp;CameraCaptureTask task,
 one gets the image from a URI (stored content or resource in ZAP file), and one takes a BitmapImage. This lets you support a variety situations, mainly because the emulator doesn't have access to the camera so you need to use pre-generated images for testing.&lt;/p&gt;
&lt;p&gt;The BarcodePhotoChooser.xaml and BarcodeSampleItemManger.cs classes can be used to implement a sample image chooser. It uses an XML file called SampleImages.xml located in the parent project (IE, the actual application not the library) to configure the images
 used as samples. These images should also be stored as content files in the parent project.&lt;/p&gt;
&lt;p&gt;The current release is pretty bare, but I hope to clean things up and add a sample app with more documentation in the near future. I already fixed a few bugs and will be doing some re-factoring to get things into a more usable state.&lt;/p&gt;
&lt;p&gt;Here is sample code for scanning barcodes:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Button click handler to initiate scanning. This should be ted to the click event for a button in your application&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; ApplicationBarIconCaptureButton_Click(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, EventArgs e)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		WP7BarcodeManager.ScanMode = com.google.zxing.BarcodeFormat.UPC_EAN;
&lt;br&gt;		&lt;span style="color:blue"&gt;if&lt;/span&gt; (bBypassCamera == &lt;span style="color:blue"&gt;true&lt;/span&gt;) &lt;span style="color:green"&gt;//Use Barcode Sample Chooser &amp;quot;Task&amp;quot; if bypass camera setting is active (Emulator/demo mode)&lt;/span&gt;
		{
			NavigationService.Navigating &amp;#43;= &lt;span style="color:blue"&gt;new&lt;/span&gt; NavigatingCancelEventHandler(NavigationService_Navigating);
			NavigationService.Navigate(BarcodeSampleItemManager.BarcodeChooserURI); &lt;span style="color:green"&gt;//Navigate to barcode chooser page located in WP7_Barcode_Library.WP7Code&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt; &lt;span style="color:green"&gt;//Use BarcodeManager to start camera and scan image&lt;/span&gt;
		{
			WP7BarcodeManager.ScanBarcode(BarcodeResults_Finished); &lt;span style="color:green"&gt;//Provide callback method&lt;/span&gt;
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing image.&amp;quot;&lt;/span&gt;, ex);
	}
}

&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Callback method that processes results returned by the WP7BarcodeManager. Results are also stored at WP7BarcodeManager.LastCaptureResults.&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;param name=&amp;quot;BCResults&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color:green"&gt;Object that holds all the results of processing the barcode. Results are also stored at WP7BarcodeManager.LastCaptureResults.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; BarcodeResults_Finished(BarcodeCaptureResult BCResults)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (WP7BarcodeManager.LastCaptureResults.BarcodeImage != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
		{
			imgCapture.Source = WP7BarcodeManager.LastCaptureResults.BarcodeImage; &lt;span style="color:green"&gt;//Display image&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			&lt;span style="color:green"&gt;//No image captured&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (BCResults.Result == BarcodeResult.Success)
		{
			txtResult.Text = BCResults.BarcodeText; &lt;span style="color:green"&gt;//Use results&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			Debug.WriteLine(BCResults.ErrorMessage);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(String.Format(&lt;span style="color:#a31515"&gt;&amp;quot;Barcode Processing Error: {0}&amp;quot;&lt;/span&gt;, ex.Message));
	}
}


&lt;span style="color:green"&gt;//Extra code required only if you are bypassing the camera&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; NavigationService_Navigating(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, NavigatingCancelEventArgs e)
{
	&lt;span style="color:blue"&gt;if&lt;/span&gt; (e.NavigationMode == NavigationMode.Back &amp;amp;&amp;amp; NavigationService.CurrentSource == BarcodeSampleItemManager.BarcodeChooserURI)
	{
		NavigationContext.QueryString[&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;] = &lt;span style="color:#a31515"&gt;&amp;quot;TRUE&amp;quot;&lt;/span&gt;;&lt;span style="color:green"&gt;//Set flag to load sample&lt;/span&gt;
	}
	&lt;span style="color:blue"&gt;else&lt;/span&gt;
	{
		NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
	}
}
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; PhoneApplicationPage_Loaded(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
	&lt;span style="color:green"&gt;//Detect if page is navigating back from BarcodeSampleChooser and start processing&lt;/span&gt;
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;string&lt;/span&gt; strFlag;
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (NavigationContext.QueryString.TryGetValue(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;, &lt;span style="color:blue"&gt;out&lt;/span&gt; strFlag))
		{
			&lt;span style="color:blue"&gt;if&lt;/span&gt; (BarcodeSampleItemManager.SelectedItem != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
			{
				WP7BarcodeManager.ScanBarcode(BarcodeSampleItemManager.SelectedItem.FileURI, &lt;span style="color:blue"&gt;new&lt;/span&gt; Action&amp;lt;BarcodeCaptureResult&amp;gt;(&lt;span style="color:blue"&gt;this&lt;/span&gt;.BarcodeResults_Finished));
			}
			&lt;span style="color:blue"&gt;else&lt;/span&gt;
			{
				MessageBox.Show(&lt;span style="color:#a31515"&gt;&amp;quot;Error: Sample chooser canceled&amp;quot;&lt;/span&gt;);
			}
			NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing sample image.&amp;quot;&lt;/span&gt;, ex);
	}
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>gbrayut</author><pubDate>Tue, 28 Dec 2010 23:17:19 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20101228111719P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://silverlightzxing.codeplex.com/documentation?version=3</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;Right now your best bet is to download the latest version of the full source code (&lt;a title="here" href="http://silverlightzxing.codeplex.com/SourceControl/list/changesets#"&gt;here&lt;/a&gt;, see link on right) and start poking around in the WP7Code folder starting
 with the&amp;nbsp;WP7Manager.cs class. You basically set WP7BarcodeManager.ScanMode to your desired scan type and then call&amp;nbsp;ScanBarcode with a callback method. There are three overrides of the ScanBarcode method, one uses the&amp;nbsp;CameraCaptureTask task,
 one gets the image from a URI (stored content or resource in ZAP file), and one takes a BitmapImage. This lets you support a variety situations, mainly because the emulator doesn't have access to the camera so you need to use pre-generated images for testing.&lt;/p&gt;
&lt;p&gt;The BarcodePhotoChooser.xaml and BarcodeSampleItemManger.cs classes can be used to implement a sample image chooser. It uses an XML file called SampleImages.xml located in the parent project (IE, the actual application not the library) to configure the images
 used as samples. These images should also be stored as content files in the parent project.&lt;/p&gt;
&lt;p&gt;The current release is pretty bare, but I hope to clean things up and add a sample app with more documentation in the near future. I already fixed a few bugs and will be doing some re-factoring to get things into a more usable state.&lt;/p&gt;
&lt;p&gt;Here is sample code for scanning barcodes:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Button click handler to initiate scanning. This should be ted to the click event for a button in your application&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; ApplicationBarIconCaptureButton_Click(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, EventArgs e)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		WP7BarcodeManager.ScanMode = com.google.zxing.BarcodeFormat.UPC_EAN;		&lt;span style="color:blue"&gt;if&lt;/span&gt; (bBypassCamera == &lt;span style="color:blue"&gt;true&lt;/span&gt;) &lt;span style="color:green"&gt;//Use Barcode Sample Chooser &amp;quot;Task&amp;quot; if bypass camera setting is active (Emulator/demo mode)&lt;/span&gt;
		{
			NavigationService.Navigating &amp;#43;= &lt;span style="color:blue"&gt;new&lt;/span&gt; NavigatingCancelEventHandler(NavigationService_Navigating);
			NavigationService.Navigate(BarcodeSampleItemManager.BarcodeChooserURI); &lt;span style="color:green"&gt;//Navigate to barcode chooser page located in WP7_Barcode_Library.WP7Code&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt; &lt;span style="color:green"&gt;//Use BarcodeManager to start camera and scan image&lt;/span&gt;
		{
			WP7BarcodeManager.ScanBarcode(BarcodeResults_Finished); &lt;span style="color:green"&gt;//Provide callback method&lt;/span&gt;
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing image.&amp;quot;&lt;/span&gt;, ex);
	}
}

&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Callback method that processes results returned by the WP7BarcodeManager. Results are also stored at WP7BarcodeManager.LastCaptureResults.&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;param name=&amp;quot;BCResults&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color:green"&gt;Object that holds all the results of processing the barcode. Results are also stored at WP7BarcodeManager.LastCaptureResults.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; BarcodeResults_Finished(BarcodeCaptureResult BCResults)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (WP7BarcodeManager.LastCaptureResults.BarcodeImage != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
		{
			imgCapture.Source = WP7BarcodeManager.LastCaptureResults.BarcodeImage; &lt;span style="color:green"&gt;//Display image&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			&lt;span style="color:green"&gt;//No image captured&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (BCResults.Result == BarcodeResult.Success)
		{
			txtResult.Text = BCResults.BarcodeText; &lt;span style="color:green"&gt;//Use results&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			Debug.WriteLine(BCResults.ErrorMessage);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(String.Format(&lt;span style="color:#a31515"&gt;&amp;quot;Barcode Processing Error: {0}&amp;quot;&lt;/span&gt;, ex.Message));
	}
}


&lt;span style="color:green"&gt;//Extra code required only if you are bypassing the camera&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; NavigationService_Navigating(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, NavigatingCancelEventArgs e)
{
	&lt;span style="color:blue"&gt;if&lt;/span&gt; (e.NavigationMode == NavigationMode.Back &amp;amp;&amp;amp; NavigationService.CurrentSource == BarcodeSampleItemManager.BarcodeChooserURI)
	{
		NavigationContext.QueryString[&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;] = &lt;span style="color:#a31515"&gt;&amp;quot;TRUE&amp;quot;&lt;/span&gt;;&lt;span style="color:green"&gt;//Set flag to load sample&lt;/span&gt;
	}
	&lt;span style="color:blue"&gt;else&lt;/span&gt;
	{
		NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
	}
}
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; PhoneApplicationPage_Loaded(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
	&lt;span style="color:green"&gt;//Detect if page is navigating back from BarcodeSampleChooser and start processing&lt;/span&gt;
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;string&lt;/span&gt; strFlag;
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (NavigationContext.QueryString.TryGetValue(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;, &lt;span style="color:blue"&gt;out&lt;/span&gt; strFlag))
		{
			&lt;span style="color:blue"&gt;if&lt;/span&gt; (BarcodeSampleItemManager.SelectedItem != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
			{
				WP7BarcodeManager.ScanBarcode(BarcodeSampleItemManager.SelectedItem.FileURI, &lt;span style="color:blue"&gt;new&lt;/span&gt; Action&amp;lt;BarcodeCaptureResult&amp;gt;(&lt;span style="color:blue"&gt;this&lt;/span&gt;.BarcodeResults_Finished));
			}
			&lt;span style="color:blue"&gt;else&lt;/span&gt;
			{
				MessageBox.Show(&lt;span style="color:#a31515"&gt;&amp;quot;Error: Sample chooser canceled&amp;quot;&lt;/span&gt;);
			}
			NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing sample image.&amp;quot;&lt;/span&gt;, ex);
	}
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>gbrayut</author><pubDate>Tue, 28 Dec 2010 23:16:12 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20101228111612P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://silverlightzxing.codeplex.com/documentation?version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;Right now your best bet is to download the latest version of the full source code (&lt;a title="here" href="http://silverlightzxing.codeplex.com/SourceControl/list/changesets#"&gt;here&lt;/a&gt;, see link on right) and start poking around in the WP7Code folder starting
 with the&amp;nbsp;WP7Manager.cs class. You basically set WP7BarcodeManager.ScanMode to your desired scan type and then call&amp;nbsp;ScanBarcode with a callback method. There are three overrides of the ScanBarcode method, one uses the&amp;nbsp;CameraCaptureTask task,
 one gets the image from a URI (stored content or resource in ZAP file), and one takes a BitmapImage. This lets you support a variety situations, mainly because the emulator doesn't have access to the camera so you need to use pre-generated images for testing.&lt;/p&gt;
&lt;p&gt;The BarcodePhotoChooser.xaml and BarcodeSampleItemManger.cs classes can be used to implement a sample image chooser. It uses an XML file called SampleImages.xml located in the parent project (IE, the actual application not the library) to configure the images
 used as samples. These images should also be stored as content files in the parent project.&lt;/p&gt;
&lt;p&gt;The current release is pretty bare, but I hope to clean things up and add a sample app with more documentation in the near future. I already fixed a few bugs and will be doing some re-factoring to get things into a more usable state.&lt;/p&gt;
&lt;p&gt;Here is sample code for scanning barcodes:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Button click handler to initiate scanning. This should be ted to the click event for a button in your application&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; ApplicationBarIconCaptureButton_Click(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, EventArgs e)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;&lt;span style="white-space:pre"&gt;		&lt;/span&gt;WP7BarcodeManager&lt;/span&gt;.ScanMode&amp;nbsp;=&amp;nbsp;com.google.zxing.&lt;span&gt;BarcodeFormat&lt;/span&gt;.UPC_EAN;&lt;/pre&gt;
&lt;pre&gt;		&lt;span style="color:blue"&gt;if&lt;/span&gt; (bBypassCamera == &lt;span style="color:blue"&gt;true&lt;/span&gt;) &lt;span style="color:green"&gt;//Use Barcode Sample Chooser &amp;quot;Task&amp;quot; if bypass camera setting is active (Emulator/demo mode)&lt;/span&gt;
		{
			NavigationService.Navigating &amp;#43;= &lt;span style="color:blue"&gt;new&lt;/span&gt; NavigatingCancelEventHandler(NavigationService_Navigating);
			NavigationService.Navigate(BarcodeSampleItemManager.BarcodeChooserURI); &lt;span style="color:green"&gt;//Navigate to barcode chooser page located in WP7_Barcode_Library.WP7Code&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt; &lt;span style="color:green"&gt;//Use BarcodeManager to start camera and scan image&lt;/span&gt;
		{
			WP7BarcodeManager.ScanBarcode(BarcodeResults_Finished); &lt;span style="color:green"&gt;//Provide callback method&lt;/span&gt;
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing image.&amp;quot;&lt;/span&gt;, ex);
	}
}

&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Callback method that processes results returned by the WP7BarcodeManager. Results are also stored at WP7BarcodeManager.LastCaptureResults.&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;param name=&amp;quot;BCResults&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color:green"&gt;Object that holds all the results of processing the barcode. Results are also stored at WP7BarcodeManager.LastCaptureResults.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; BarcodeResults_Finished(BarcodeCaptureResult BCResults)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (WP7BarcodeManager.LastCaptureResults.BarcodeImage != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
		{
			imgCapture.Source = WP7BarcodeManager.LastCaptureResults.BarcodeImage; &lt;span style="color:green"&gt;//Display image&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			&lt;span style="color:green"&gt;//No image captured&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (BCResults.Result == BarcodeResult.Success)
		{
			txtResult.Text = BCResults.BarcodeText; &lt;span style="color:green"&gt;//Use results&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			Debug.WriteLine(BCResults.ErrorMessage);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(String.Format(&lt;span style="color:#a31515"&gt;&amp;quot;Barcode Processing Error: {0}&amp;quot;&lt;/span&gt;, ex.Message));
	}
}


&lt;span style="color:green"&gt;//Extra code required only if you are bypassing the camera&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; NavigationService_Navigating(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, NavigatingCancelEventArgs e)
{
	&lt;span style="color:blue"&gt;if&lt;/span&gt; (e.NavigationMode == NavigationMode.Back &amp;amp;&amp;amp; NavigationService.CurrentSource == BarcodeSampleItemManager.BarcodeChooserURI)
	{
		NavigationContext.QueryString[&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;] = &lt;span style="color:#a31515"&gt;&amp;quot;TRUE&amp;quot;&lt;/span&gt;;&lt;span style="color:green"&gt;//Set flag to load sample&lt;/span&gt;
	}
	&lt;span style="color:blue"&gt;else&lt;/span&gt;
	{
		NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
	}
}
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; PhoneApplicationPage_Loaded(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
	&lt;span style="color:green"&gt;//Detect if page is navigating back from BarcodeSampleChooser and start processing&lt;/span&gt;
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;string&lt;/span&gt; strFlag;
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (NavigationContext.QueryString.TryGetValue(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;, &lt;span style="color:blue"&gt;out&lt;/span&gt; strFlag))
		{
			&lt;span style="color:blue"&gt;if&lt;/span&gt; (BarcodeSampleItemManager.SelectedItem != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
			{
				WP7BarcodeManager.ScanBarcode(BarcodeSampleItemManager.SelectedItem.FileURI, &lt;span style="color:blue"&gt;new&lt;/span&gt; Action&amp;lt;BarcodeCaptureResult&amp;gt;(&lt;span style="color:blue"&gt;this&lt;/span&gt;.BarcodeResults_Finished));
			}
			&lt;span style="color:blue"&gt;else&lt;/span&gt;
			{
				MessageBox.Show(&lt;span style="color:#a31515"&gt;&amp;quot;Error: Sample chooser canceled&amp;quot;&lt;/span&gt;);
			}
			NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing sample image.&amp;quot;&lt;/span&gt;, ex);
	}
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>gbrayut</author><pubDate>Tue, 28 Dec 2010 23:14:43 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20101228111443P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://silverlightzxing.codeplex.com/documentation?version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;Right now your best bet is to download the latest version of the full source code (&lt;a title="here" href="http://silverlightzxing.codeplex.com/SourceControl/list/changesets#"&gt;here&lt;/a&gt;, see link on right) and start poking around in the WP7Code folder starting
 with the&amp;nbsp;WP7Manager.cs class. You basically set WP7BarcodeManager.ScanMode to your desired scan type and then call&amp;nbsp;ScanBarcode with a callback method. There are three overrides of the ScanBarcode method, one uses the&amp;nbsp;CameraCaptureTask task,
 one gets the image from a URI (stored content or resource in ZAP file), and one takes a BitmapImage. This lets you support a variety situations, mainly because the emulator doesn't have access to the camera so you need to use pre-generated images for testing.&lt;/p&gt;
&lt;p&gt;The BarcodePhotoChooser.xaml and BarcodeSampleItemManger.cs classes can be used to implement a sample image chooser. It uses an XML file called SampleImages.xml located in the parent project (IE, the actual application not the library) to configure the images
 used as samples. These images should also be stored as content files in the parent project.&lt;/p&gt;
&lt;p&gt;The current release is pretty bare, but I hope to clean things up and add a sample app with more documentation in the near future. I already fixed a few bugs and will be doing some re-factoring to get things into a more usable state.&lt;/p&gt;
&lt;p&gt;Here is sample code for scanning barcodes:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Button click handler to initiate scanning. This should be ted to the click event for a button in your application&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; ApplicationBarIconCaptureButton_Click(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, EventArgs e)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (bBypassCamera == &lt;span style="color:blue"&gt;true&lt;/span&gt;) &lt;span style="color:green"&gt;//Use Barcode Sample Chooser &amp;quot;Task&amp;quot; if bypass camera setting is active (Emulator/demo mode)&lt;/span&gt;
		{
			NavigationService.Navigating &amp;#43;= &lt;span style="color:blue"&gt;new&lt;/span&gt; NavigatingCancelEventHandler(NavigationService_Navigating);
			NavigationService.Navigate(BarcodeSampleItemManager.BarcodeChooserURI); &lt;span style="color:green"&gt;//Navigate to barcode chooser page located in WP7_Barcode_Library.WP7Code&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt; &lt;span style="color:green"&gt;//Use BarcodeManager to start camera and scan image&lt;/span&gt;
		{
			WP7BarcodeManager.ScanBarcode(BarcodeResults_Finished); &lt;span style="color:green"&gt;//Provide callback method&lt;/span&gt;
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing image.&amp;quot;&lt;/span&gt;, ex);
	}
}

&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Callback method that processes results returned by the WP7BarcodeManager. Results are also stored at WP7BarcodeManager.LastCaptureResults.&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:gray"&gt;///&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;lt;param name=&amp;quot;BCResults&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color:green"&gt;Object that holds all the results of processing the barcode. Results are also stored at WP7BarcodeManager.LastCaptureResults.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; BarcodeResults_Finished(BarcodeCaptureResult BCResults)
{
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (WP7BarcodeManager.LastCaptureResults.BarcodeImage != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
		{
			imgCapture.Source = WP7BarcodeManager.LastCaptureResults.BarcodeImage; &lt;span style="color:green"&gt;//Display image&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			&lt;span style="color:green"&gt;//No image captured&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (BCResults.Result == BarcodeResult.Success)
		{
			txtResult.Text = BCResults.BarcodeText; &lt;span style="color:green"&gt;//Use results&lt;/span&gt;
		}
		&lt;span style="color:blue"&gt;else&lt;/span&gt;
		{
			Debug.WriteLine(BCResults.ErrorMessage);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(String.Format(&lt;span style="color:#a31515"&gt;&amp;quot;Barcode Processing Error: {0}&amp;quot;&lt;/span&gt;, ex.Message));
	}
}


&lt;span style="color:green"&gt;//Extra code required only if you are bypassing the camera&lt;/span&gt;
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; NavigationService_Navigating(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, NavigatingCancelEventArgs e)
{
	&lt;span style="color:blue"&gt;if&lt;/span&gt; (e.NavigationMode == NavigationMode.Back &amp;amp;&amp;amp; NavigationService.CurrentSource == BarcodeSampleItemManager.BarcodeChooserURI)
	{
		NavigationContext.QueryString[&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;] = &lt;span style="color:#a31515"&gt;&amp;quot;TRUE&amp;quot;&lt;/span&gt;;&lt;span style="color:green"&gt;//Set flag to load sample&lt;/span&gt;
	}
	&lt;span style="color:blue"&gt;else&lt;/span&gt;
	{
		NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
	}
}
&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; PhoneApplicationPage_Loaded(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
	&lt;span style="color:green"&gt;//Detect if page is navigating back from BarcodeSampleChooser and start processing&lt;/span&gt;
	&lt;span style="color:blue"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:blue"&gt;string&lt;/span&gt; strFlag;
		&lt;span style="color:blue"&gt;if&lt;/span&gt; (NavigationContext.QueryString.TryGetValue(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;, &lt;span style="color:blue"&gt;out&lt;/span&gt; strFlag))
		{
			&lt;span style="color:blue"&gt;if&lt;/span&gt; (BarcodeSampleItemManager.SelectedItem != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
			{
				WP7BarcodeManager.ScanBarcode(BarcodeSampleItemManager.SelectedItem.FileURI, &lt;span style="color:blue"&gt;new&lt;/span&gt; Action&amp;lt;BarcodeCaptureResult&amp;gt;(&lt;span style="color:blue"&gt;this&lt;/span&gt;.BarcodeResults_Finished));
			}
			&lt;span style="color:blue"&gt;else&lt;/span&gt;
			{
				MessageBox.Show(&lt;span style="color:#a31515"&gt;&amp;quot;Error: Sample chooser canceled&amp;quot;&lt;/span&gt;);
			}
			NavigationContext.QueryString.Remove(&lt;span style="color:#a31515"&gt;&amp;quot;LOADSAMPLE&amp;quot;&lt;/span&gt;);
		}
	}
	&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
	{
		Debug.WriteLine(&lt;span style="color:#a31515"&gt;&amp;quot;Error processing sample image.&amp;quot;&lt;/span&gt;, ex);
	}
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>gbrayut</author><pubDate>Tue, 28 Dec 2010 22:50:16 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20101228105016P</guid></item></channel></rss>