Note that there are some explanatory texts on larger screens.

plurals
  1. POPass radio button content between pages
    text
    copied!<p>I want to pass radio button content between pages. XAML Code:</p> <pre><code>&lt;RadioButton Name="errorCorrectionHLevelRadioButton" Content="H (~30% correction)" GroupName="errorCorrectionLevel" IsChecked="True" BorderBrush="Black" Foreground="Black" Background="Black" /&gt; &lt;RadioButton Name="errorCorrectionLLevelRadioButton" Content="Q (~25% correction)" GroupName="errorCorrectionLevel" BorderBrush="Black" Foreground="Black" Background="Black" /&gt; &lt;RadioButton Name="errorCorrectionMLevelRadioButton" Content="M (~15% correction)" GroupName="errorCorrectionLevel" BorderBrush="Black" Foreground="Black" Background="Black" /&gt; &lt;RadioButton Name="errorCorrectionQLevelRadioButton" Content="L (~7% correction)" GroupName="errorCorrectionLevel" BorderBrush="Black" Foreground="Black" Background="Black" /&gt; </code></pre> <p>First page code:</p> <pre><code>string myECL; if (errorCorrectionHLevelRadioButton.IsChecked == true) myECL = ErrorCorrectionLevel.H.ToString(); else if (errorCorrectionQLevelRadioButton.IsChecked == true) myECL = ErrorCorrectionLevel.Q.ToString(); else if (errorCorrectionMLevelRadioButton.IsChecked == true) myECL = ErrorCorrectionLevel.M.ToString(); else myECL = ErrorCorrectionLevel.L.ToString(); NavigationService.Navigate(new Uri("/QRGeneratePage.xaml?text=" + textToEncodeTextBox.Text +"&amp;errorCorrection="+myECL+"&amp;logo="+logoQrCodeImage.Source, UriKind.Relative)); </code></pre> <p>And on the second page I want to use date form radio buton. For example: I have a constructor where:</p> <pre><code> string errorCorrectionLevelChoose = String.Empty; if (NavigationContext.QueryString.TryGetValue("errorCorrection", out errorCorrectionLevelChoose)) { ErrorCorrectionLevel ecl = (ZXing.QrCode.Internal.ErrorCorrectionLevel)errorCorrectionLevelChoose; } var writer = new BarcodeWriter { Format = BarcodeFormat.QR_CODE, Renderer = new ZXing.Rendering.WriteableBitmapRenderer() { Foreground = colorQRCode }, Options = new ZXing.QrCode.QrCodeEncodingOptions { Height = 300, Width = 300, Margin = 1, ErrorCorrection = ErrorCorrectionLevel.H } }; </code></pre> <p>In this line ErrorCorrection = ErrorCorrectionLevel.H I want to use my data from radio button. So if user choose </p> <pre><code>&lt;RadioButton Name="errorCorrectionLLevelRadioButton" Content="Q (~25% correction)" GroupName="errorCorrectionLevel" BorderBrush="Black" Foreground="Black" Background="Black" /&gt; </code></pre> <p>On the second page it will be:</p> <pre><code>ErrorCorrection = ErrorCorrectionLevel.Q </code></pre> <p>Do you know how I can do this ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload