diff --git a/GettingStarted/GettingStarted.csproj b/GettingStarted/GettingStarted.csproj index 91b092b..c1a8bd6 100644 --- a/GettingStarted/GettingStarted.csproj +++ b/GettingStarted/GettingStarted.csproj @@ -1,16 +1,16 @@ - - WinExe - net6.0-windows10.0.19041.0 - 10.0.17763.0 - GettingStarted - app.manifest - x86;x64;arm64 - win10-x86;win10-x64;win10-arm64 - win10-$(Platform).pubxml - true - true - + + WinExe + net10.0-windows10.0.19041.0 + 10.0.17763.0 + GettingStarted + app.manifest + x86;x64;ARM64 + win-x86;win-x64;win-arm64 + win-$(Platform).pubxml + true + true + @@ -23,8 +23,8 @@ - - + + diff --git a/GettingStarted/Properties/PublishProfiles/win10-arm64.pubxml b/GettingStarted/Properties/PublishProfiles/win-arm64.pubxml similarity index 93% rename from GettingStarted/Properties/PublishProfiles/win10-arm64.pubxml rename to GettingStarted/Properties/PublishProfiles/win-arm64.pubxml index a132e44..dd2c455 100644 --- a/GettingStarted/Properties/PublishProfiles/win10-arm64.pubxml +++ b/GettingStarted/Properties/PublishProfiles/win-arm64.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem arm64 - win10-arm64 + win-arm64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/GettingStarted/Properties/PublishProfiles/win10-x64.pubxml b/GettingStarted/Properties/PublishProfiles/win-x64.pubxml similarity index 93% rename from GettingStarted/Properties/PublishProfiles/win10-x64.pubxml rename to GettingStarted/Properties/PublishProfiles/win-x64.pubxml index 26ea7e5..ca40a9e 100644 --- a/GettingStarted/Properties/PublishProfiles/win10-x64.pubxml +++ b/GettingStarted/Properties/PublishProfiles/win-x64.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem x64 - win10-x64 + win-x64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/GettingStarted/Properties/PublishProfiles/win10-x86.pubxml b/GettingStarted/Properties/PublishProfiles/win-x86.pubxml similarity index 93% rename from GettingStarted/Properties/PublishProfiles/win10-x86.pubxml rename to GettingStarted/Properties/PublishProfiles/win-x86.pubxml index 34d14d4..be62e6b 100644 --- a/GettingStarted/Properties/PublishProfiles/win10-x86.pubxml +++ b/GettingStarted/Properties/PublishProfiles/win-x86.pubxml @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem x86 - win10-x86 + win-x86 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ true False diff --git a/README.md b/README.md index 7503118..73cb5c8 100644 --- a/README.md +++ b/README.md @@ -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 +```xaml + + + + + + + + + + + ``` +###### 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 + + + + + + + + + + + + + + + + + + + + +``` + +## 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 + +![WinUI Barcode Getting Started image](GettingStarted/Images/Getting_Started.png) + +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.