Skip to content

Commit ea695f8

Browse files
author
Vignesh Ramesh
authored
Merge pull request #1 from VishalOmprasad/master
XAMARIN-43979 : Code example site improvements
2 parents cc2fb4e + 9a44547 commit ea695f8

File tree

5 files changed

+45
-83
lines changed

5 files changed

+45
-83
lines changed

Borderless_NumericUpDown/NumericSample/NumericSample.Android/NumericSample.Android.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
1717
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
1818
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
19-
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
19+
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
2020
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
2121
<AndroidUseAapt2>true</AndroidUseAapt2>
2222
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
@@ -56,9 +56,8 @@
5656
<PackageReference Include="Syncfusion.Xamarin.SfNumericUpDown">
5757
<Version>*</Version>
5858
</PackageReference>
59-
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
60-
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
61-
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
59+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
60+
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
6261
</ItemGroup>
6362
<ItemGroup>
6463
<Compile Include="CustomNumericUpDownRenderer.cs" />

Borderless_NumericUpDown/NumericSample/NumericSample.UWP/NumericSample.UWP.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
<PackageReference Include="Syncfusion.Xamarin.SfNumericUpDown">
148148
<Version>*</Version>
149149
</PackageReference>
150-
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
150+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
151151
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9" />
152-
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
152+
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
153153
</ItemGroup>
154154
<ItemGroup>
155155
<ProjectReference Include="..\NumericSample\NumericSample.csproj">

Borderless_NumericUpDown/NumericSample/NumericSample.iOS/NumericSample.iOS.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124
<PackageReference Include="Syncfusion.Xamarin.SfNumericUpDown">
125125
<Version>*</Version>
126126
</PackageReference>
127-
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
128-
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
127+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
128+
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
129129
</ItemGroup>
130130
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
131131
<ItemGroup>

Borderless_NumericUpDown/NumericSample/NumericSample/NumericSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<ItemGroup>
99
<PackageReference Include="Syncfusion.Xamarin.SfNumericUpDown" Version="*" />
10-
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
11-
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
10+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
11+
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
1212
</ItemGroup>
1313
</Project>

README.md

Lines changed: 36 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,52 @@
1-
# How to create a borderless Xamarin.Forms numeric control (SfNumericUpDown)
1+
# How to create a borderless Xamarin.Forms numeric control SfNumericUpDown
22

3-
This article explains how to create a Syncfusion SfNumericUpDown without having its border as per in the following image
3+
This repository contains sample to create a borderless [Syncfusion Xamarin.Forms Numeric UpDown](https://help.syncfusion.com/xamarin/numericupdown/getting-started) control.
44

5-
![](Output.png)
5+
Please refer the KB through this [link](https://www.syncfusion.com/kb/11873/how-to-create-a-borderless-xamarin-forms-numeric-control-sfnumericupdown).
66

7-
It has been achieved by using its custom renderer of Xamarin.Forms SfNumericUpDown with platform specific as per in the below code changes.
7+
## Syncfusion controls:
88

9-
**[XAML]**
9+
This project used the following Syncfusion control(s):
10+
* [SfNumericUpDown](https://www.syncfusion.com/xamarin-ui-controls/xamarin-numericupdown)
1011

11-
*Control initialization with custom numericUpDown class*
12+
## Supported platforms
1213

13-
```
14-
<local:CustomNumericUpDown x:Name="sfNumericUpDown" HeightRequest="100" Value="100" AllowNull="false" FormatString="n"/>
15-
```
16-
*Create a CustomNumericUpDown class which is inherited from SfNumericUpDown.*
14+
| Platforms | Supported versions |
15+
| --------- | ------------------ |
16+
| Android | API level 21 and later versions |
17+
| iOS | iOS 9.0 and later versions |
18+
| UWP | Windows 10 devices |
1719

18-
```
19-
public class CustomNumericUpDown : SfNumericUpDown
20-
{
21-
}
22-
```
20+
## Requirements to run the sample
2321

24-
## Android
25-
It has been achieved by setting null to the EditText Background which is a child of native numeric control as shown in below
22+
* [Visual Studio](https://visualstudio.microsoft.com/downloads/) or [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/)
2623

27-
```
28-
protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.SfNumericUpDown.XForms.SfNumericUpDown> e)
29-
{
30-
base.OnElementChanged(e);
31-
if (Control != null)
32-
{
33-
for (int i = 0; i < Control.ChildCount; i++)
34-
{
35-
var child = Control.GetChildAt(i);
36-
if (child is EditText)
37-
{
38-
var control = child as EditText;
39-
control.Background = null;
40-
}
41-
}
42-
}
43-
}
44-
```
24+
Refer to the following link for more details - [System Requirements](https://help.syncfusion.com/xamarin/system-requirements)
4525

46-
## iOS
47-
To achieve the same in iOS, set the 0 as border width of its native control.
26+
## How to run the sample
4827

49-
```
50-
protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.SfNumericUpDown.XForms.SfNumericUpDown> e)
51-
{
52-
base.OnElementChanged(e);
53-
if (this.Control != null)
54-
{
55-
/// For Achieving Borderwidth customization.
56-
this.Control.Layer.BorderWidth = 0f;
57-
}
58-
}
59-
```
28+
1. Clone the sample and open it in Visual Studio.
6029

61-
## UWP
62-
By setting the 0 as border thickness as shown in below
63-
64-
```
65-
protected override void OnElementChanged(ElementChangedEventArgs<SfNumericUpDown> e)
66-
{
67-
base.OnElementChanged(e);
68-
if (Control != null)
69-
{
70-
Control.BorderThickness = new Windows.UI.Xaml.Thickness(0);
71-
}
72-
}
73-
```
74-
75-
## See also
76-
77-
[How to change border thickness of numeric control](https://www.syncfusion.com/kb/7633/how-to-change-borderwidth-of-numericupdown-by-using-custom-renderer)
78-
79-
[Spin Button Customization in Xamarin NumericUpDown (SfNumericUpDown)](https://help.syncfusion.com/xamarin/numericupdown/spin-button-customization)
80-
81-
[How to customize the color appearance of numeric controls in Xamarin.Forms](https://www.syncfusion.com/kb/11610/how-to-customize-the-color-appearance-of-numeric-controls-in-xamarin-forms)
82-
83-
[How to customize the spin button of the NumericUpDown](https://www.syncfusion.com/kb/10156/how-to-customise-the-spin-button-of-the-numericupdown)
84-
85-
[Auto Reverse in Xamarin NumericUpDown (SfNumericUpDown)](https://help.syncfusion.com/xamarin/numericupdown/auto-reverse)
30+
*Note: If you download the sample using the "Download ZIP" option, right-click it, select Properties, and then select Unblock.*
31+
32+
2. Register your license key in the App.xaml.cs file as demonstrated in the following code.
8633

34+
public App()
35+
{
36+
//Register Syncfusion license
37+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
38+
39+
InitializeComponent();
40+
41+
MainPage = new App1.MainPage();
42+
}
43+
44+
Refer to this [link](https://help.syncfusion.com/xamarin/licensing/overview) for more details.
45+
46+
3. Clean and build the application.
8747

48+
4. Run the application.
8849

50+
## License
8951

52+
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.

0 commit comments

Comments
 (0)