Skip to content

Commit 2430fe7

Browse files
Merge pull request #1 from VishalOmprasad/master
XAMARIN-43979 : Code example site improvements
2 parents 79441d3 + 19015a5 commit 2430fe7

File tree

5 files changed

+42
-76
lines changed

5 files changed

+42
-76
lines changed

GettingStarted_NumericTextBox/GettingStarted_NumericTextBox.Android/GettingStarted_NumericTextBox.Android.csproj

Lines changed: 2 additions & 7 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
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
2121
<NuGetPackageImportStamp>
2222
</NuGetPackageImportStamp>
@@ -52,12 +52,7 @@
5252
<PackageReference Include="Syncfusion.Xamarin.SfNumericTextBox">
5353
<Version>*</Version>
5454
</PackageReference>
55-
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1142" />
56-
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
57-
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
58-
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
59-
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
60-
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
55+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
6156
</ItemGroup>
6257
<ItemGroup>
6358
<Compile Include="MainActivity.cs" />

GettingStarted_NumericTextBox/GettingStarted_NumericTextBox.UWP/GettingStarted_NumericTextBox.UWP.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@
146146
<PackageReference Include="Syncfusion.Xamarin.SfNumericTextBox">
147147
<Version>*</Version>
148148
</PackageReference>
149-
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1142" />
150-
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.5" />
149+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
150+
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.12" />
151151
</ItemGroup>
152152
<ItemGroup>
153153
<ProjectReference Include="..\GettingStarted_NumericTextBox\GettingStarted_NumericTextBox.csproj">

GettingStarted_NumericTextBox/GettingStarted_NumericTextBox.iOS/GettingStarted_NumericTextBox.iOS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
<PackageReference Include="Syncfusion.Xamarin.SfNumericTextBox">
152152
<Version>*</Version>
153153
</PackageReference>
154-
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1142" />
154+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
155155
</ItemGroup>
156156
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
157157
<ItemGroup>

GettingStarted_NumericTextBox/GettingStarted_NumericTextBox/GettingStarted_NumericTextBox.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Syncfusion.Xamarin.SfNumericTextBox" Version="*" />
14-
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1142" />
14+
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
1515
</ItemGroup>
1616
</Project>

README.md

Lines changed: 36 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,52 @@
1-
# How-to-change-the-Xamarin.Forms-numeric-textbox-style-using-its-visual-states
1+
# How to change the Xamarin.Forms numeric textbox style using its visual states
22

3-
This article explains how to customize the Syncfusion Xamarin.Forms numeric text box control using visual states.
3+
This repository contains sample to customize the [Syncfusion Xamarin.Forms Numeric TextBox](https://help.syncfusion.com/xamarin/numeric-entry/getting-started) control's style using visual states.
44

5-
Let’s have a use case to keep default styles with having different background color which is varying based on its visual states if then Xamarin.Forms numeric text box control allows to do that with the help of global styles in Xamarin.Forms as per in below code snippet.
5+
Please refer the KB through this [link](https://www.syncfusion.com/kb/11785/how-to-change-the-xamarin-forms-numeric-textbox-style-using-its-visual-states).
66

7-
[App.xaml]
7+
## Syncfusion controls:
88

9-
```
10-
9+
This project used the following Syncfusion control(s):
10+
* [SfNumericTextBox](https://www.syncfusion.com/xamarin-ui-controls/xamarin-numeric-entry)
1111

12-
<Application.Resources>
13-
<ResourceDictionary>
14-
<Style x:Key="NumericTextBoxStyle" TargetType="numeric:SfNumericTextBox">
15-
<Setter Property="VisualStateManager.VisualStateGroups">
16-
<VisualStateGroupList>
17-
<VisualStateGroup x:Name="CommonStates">
18-
<VisualState x:Name="Normal">
19-
<VisualState.Setters>
20-
<Setter Property="BackgroundColor" Value="White" />
21-
</VisualState.Setters>
22-
</VisualState>
23-
<VisualState x:Name="Disabled">
24-
<VisualState.Setters>
25-
<Setter Property="BackgroundColor" Value="DarkGray" />
26-
</VisualState.Setters>
27-
</VisualState>
28-
<VisualState x:Name="Focused">
29-
<VisualState.Setters>
30-
<Setter Property="BackgroundColor" Value="Yellow" />
31-
</VisualState.Setters>
32-
</VisualState>
33-
</VisualStateGroup>
34-
</VisualStateGroupList>
35-
</Setter>
36-
</Style>
37-
</ResourceDictionary>
38-
</Application.Resources>
12+
## Supported platforms
3913

40-
41-
```
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 |
4219

43-
[XAML]
20+
## Requirements to run the sample
4421

45-
```
46-
22+
* [Visual Studio](https://visualstudio.microsoft.com/downloads/) or [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/)
4723

48-
<numeric:SfNumericTextBox x:Name="numericTextBox" Margin="0,20,0,0" Style="{StaticResource NumericTextBoxStyle}" Value="50"/>
24+
Refer to the following link for more details - [System Requirements](https://help.syncfusion.com/xamarin/system-requirements)
4925

50-
51-
```
26+
## How to run the sample
5227

53-
## Screenshot:
28+
1. Clone the sample and open it in Visual Studio.
5429

55-
Normal State:
56-
57-
![Output image of NumericTextBox in normal state](Outputs/NumericTextBoxNormalState.jpg)
58-
59-
Focused State:
60-
61-
![Output image of NumericTextBox in focused state](Outputs/NumericTextBoxFocused.jpg)
62-
63-
Disabled State:
64-
65-
![Output image of NumericTextBox in disabled state](Outputs/NumericTextBoxDisabled.jpg)
66-
67-
## See also
68-
69-
[To customize the font style of NumericTextBox](https://help.syncfusion.com/xamarin/numeric-entry/font-settings)
70-
71-
[To set maximum number of demical digits in NumerTextBox](https://help.syncfusion.com/xamarin/numeric-entry/set-maximum-number-of-decimal-digits)
72-
73-
[Custom numeric format strings](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings#the--custom-specifier)
74-
75-
[Number of decimal digits display](https://www.syncfusion.com/kb/7059/how-to-modify-number-of-decimal-digits-display)
76-
77-
[Allowing null value](https://help.syncfusion.com/xamarin/numeric-entry/assign-nullable-value)
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.
7833

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.
7947

48+
4. Run the application.
8049

50+
## License
8151

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)