-
Notifications
You must be signed in to change notification settings - Fork 1
1040317 - .Net 10 updated to sample #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,151 @@ | ||
| # WinUI Barcode Example (How to add Barcode control in WinUI application) | ||
|
|
||
| This repository contains sample for how to add the [Syncfusion WinUI Barcode](https://help.syncfusion.com/winui/barcode/getting-started) control in WinUI application. The WinUI Barcode control helps you to generate and display data in a machine-readable format. It provides a perfect approach for encoding text using the supported barcode types. | ||
|
|
||
| ## Syncfuion controls | ||
|
|
||
| This project used the following Syncfusion control(s): | ||
| * [SfBarcode](https://www.syncfusion.com/winui-controls/barcode) | ||
|
|
||
| ## Requirements to run the sample | ||
|
|
||
| * [Visual Studio](https://visualstudio.microsoft.com/downloads/) | ||
| * [Windows App SDK 1.1 extension](https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/stable-channel#version-11) | ||
| * .NET 6.0 | ||
|
|
||
| Refer to the following link for more details - [System Requirements](https://help.syncfusion.com/winui/system-requirements) | ||
|
|
||
| ## How to run the sample | ||
|
|
||
| 1. Clone the sample and open it in Visual Studio. | ||
|
|
||
| *Note: If you download the sample using the "Download ZIP" option, right-click it, select Properties, and then select Unblock.* | ||
|
|
||
| 2. Register your license key in the App.cs file as demonstrated in the following code. | ||
|
|
||
| public App() | ||
| # GettingStarted Barcode WinUI | ||
| This is demo application of WinUI SfBarcode control. The minimal set of required properties have been configured in this project to get started with SfBarcode in WinUI. | ||
|
|
||
| ## Description | ||
|
|
||
| The [SfBarcode](https://help.syncfusion.com/winui/barcode/getting-started) control helps you to generate and display data in a machine-readable format. It provides a perfect approach for encoding text using the supported barcode types. | ||
|
|
||
| ## Initialize Barcode | ||
| Add reference to [Syncfusion.Barcode.WinUI](https://www.nuget.org/packages/Syncfusion.Barcode.WinUI) NuGet and import the control namespace `Syncfusion.UI.Xaml.Barcode` in XAML or C# to initialize the control. | ||
|
|
||
| ###### Xaml | ||
|
vasavi-s-SF4854 marked this conversation as resolved.
|
||
| ```xaml | ||
|
|
||
| <Window | ||
| ..... | ||
| xmlns:syncfusion="using:Syncfusion.UI.Xaml.Barcode"> | ||
|
|
||
| <syncfusion:SfBarcode Value="48625310"> | ||
| <syncfusion:SfBarcode.Symbology> | ||
| <syncfusion:CodabarBarcode /> | ||
| </syncfusion:SfBarcode.Symbology> | ||
| </syncfusion:SfBarcode> | ||
|
|
||
| </Window> | ||
| ``` | ||
| ###### C# | ||
| ```C# | ||
|
|
||
| using Syncfusion.UI.Xaml.Barcode; | ||
|
|
||
| namespace GettingStarted | ||
| { | ||
| public sealed partial class MainWindow : Window | ||
| { | ||
| public MainWindow() | ||
| { | ||
| //Register Syncfusion license | ||
| Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); | ||
|
|
||
| InitializeComponent(); | ||
|
|
||
| MainPage = new NavigationPage(new MainPage()); | ||
|
|
||
| SfBarcode barcode = new SfBarcode(); | ||
| CodabarBarcode codabarBarcode = new CodabarBarcode(); | ||
| barcode.Symbology = codabarBarcode; | ||
| barcode.Value = "48625310"; | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Switching Symbology | ||
|
|
||
| This sample demonstrates how to switch between different barcode symbologies at runtime. The sample uses a ViewModel to manage the symbology selection and binds it to the barcode control. | ||
|
|
||
| ###### Xaml | ||
| ```xaml | ||
| <Window | ||
| x:Class="GettingStarted.MainWindow" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:local="using:GettingStarted" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:syncfusion="using:Syncfusion.UI.Xaml.Barcode" | ||
| xmlns:core="using:Syncfusion.UI.Xaml.Core" | ||
| mc:Ignorable="d"> | ||
|
|
||
| <Grid> | ||
| <Grid.DataContext> | ||
| <local:ViewModel /> | ||
| </Grid.DataContext> | ||
| <Grid.ColumnDefinitions> | ||
| <ColumnDefinition Width="*" /> | ||
| <ColumnDefinition Width="Auto" /> | ||
| </Grid.ColumnDefinitions> | ||
| <StackPanel Grid.Column="0" | ||
| Margin="0,100,0,0" | ||
| HorizontalAlignment="Center"> | ||
| <syncfusion:SfBarcode x:Name="barcode" | ||
| Width="340" | ||
| Height="150" | ||
| Module="{Binding ModuleValue}" | ||
| Symbology="{Binding SymbologyItem}" | ||
| Value="48625310" /> | ||
| </StackPanel> | ||
| <StackPanel Grid.Column="1" | ||
| Orientation="Vertical"> | ||
| <ComboBox x:Name="symbology" | ||
| Width="185" | ||
| Margin="10" | ||
| DisplayMemberPath="SymobologyItem" | ||
| Header="Symbology" | ||
| ItemsSource="{Binding Symbology}" | ||
| SelectedIndex="0" | ||
| SelectedItem="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> | ||
| <ComboBox x:Name="rotationAngle" | ||
| Width="185" | ||
| Margin="10" | ||
| Header="RotationAngle" | ||
| ItemsSource="{core:EnumValuesExtension Type=syncfusion:BarcodeRotation}" | ||
| SelectedItem="{Binding ElementName=barcode, Path=RotationAngle, Mode=TwoWay}" /> | ||
| <CheckBox x:Name="showValue" | ||
| Width="185" | ||
| Margin="12,10,10,10" | ||
| Content="ShowValue" | ||
| IsChecked="{Binding ElementName=barcode, Path=ShowValue, Mode=TwoWay}" /> | ||
| </StackPanel> | ||
| </Grid> | ||
| </Window> | ||
| ``` | ||
|
|
||
| ## Supported Symbologies | ||
|
|
||
| The SfBarcode control supports various symbology types. In this sample, you can switch between the following symbologies: | ||
| * CodaBar | ||
| * Code11 | ||
| * Code32 | ||
| * Code39 | ||
| * Code39Extended | ||
| * Code93 | ||
| * Code93Extended | ||
| * Code128A | ||
| * Code128B | ||
| * Code128C | ||
| * UpcBarcode | ||
| * DataMatrix | ||
| * QRBarcode | ||
|
|
||
| ## Customization Options | ||
|
|
||
| The sample also demonstrates several customization options for the barcode: | ||
|
|
||
| ### Module | ||
| The width ratio of the wide and narrow bars can be changed using the Module property. | ||
|
|
||
| ### Rotation Angle | ||
| The barcode can be rotated in various angles using the RotationAngle property. | ||
|
|
||
| ### Show Value | ||
| The visibility of the barcode text can be controlled using the ShowValue property. | ||
|
|
||
| ## Output | ||
|
|
||
|  | ||
|
|
||
| For more details please refer this ug [Barcode](https://help.syncfusion.com/winui/barcode/getting-started/?utm_medium=listing&utm_source=github-examples). | ||
|
|
||
|
|
||
|
|
||
|
|
||
| Refer to this [link](https://help.syncfusion.com/winui/licensing/overview) for more details. | ||
|
|
||
| 3. Clean and build the application. | ||
|
|
||
| 4. Run the application. | ||
|
|
||
| ## License | ||
|
|
||
| Syncfusion has no liability for any damage or consequence that may arise by using or viewing the samples. The samples are for demonstrative purposes, and if you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage that is related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion’s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion’s samples. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.