Bold BI®Unlock stunning dashboards with Bold BI®: 35+ widgets, 150+ data sources, AI agent & more. Try it for free!
Hi. I was using Syncfusion for Xamarin.Forms 21.2.3 but I have now upgraded to the latest 22.1.38, and I can confirm the problem also exists in this version too.
My Xamarin.Form 5 shell application allows the user to configure if they prefer light or dark themes, and will switch at runtime by setting the application property Application.Current.UserAppTheme
It has been reported to me that after having switched themes, SfNumericalTextBox ui controls no longer look editable, unless the application is restarted. I have confirm this report is accurate, and have also observed an anomaly with regards to the BorderColor property.....
Although my application makes use of application wide styles in App.xaml and sometimes also local styles defined within the .xaml for pages, I actually had not assigned any default value for SfNumericTextBox.BoarderColor in any style. This means that the "border" (actually the underlining of the editable area) is the default pink colour, the same as the flashing cursor. Here are 3 such controls, in first "Light" then "Dark" themes
which look like then when I have switched theme to "Dark" and "Light" respectively
As you can see the "border" (underlining) is no longer visible. Whilst not capture in the last 2 images above, the pink cursor was still flashing. Once the app is restarted, it looks ok again
So I tried adding a default color for both Light and Dark themes in my SfNumericTextBox style, rather than relying on any other default
<Setter Property="BorderColor" Value="{AppThemeBinding Dark=Red, Light=Lime}" />
And now I find that whilst it does take note of the new defaults, when I change the theme, it causes the background of the whole of the SfNumericTextBox to go that colour. One the app is restarted, it looks ok again.
These images show the same as above, but when my style provides a BorderColor property
when switched to dark and light repectively
So to conclude, I believe this control is making correct use of the property as defined by the theme, except where the theme changes at runtime.
Hi Paul,
We have reviewed your query and have created a sample based on the provided information. But we were not able to reproduce the reported problem at our end. We have attached tested sample for your reference. In the sample, we have changed the Dark theme and LightTheme using the App.Current.UserAppTheme in Button Clicked event. We have also set the BorderColor and TextColor of the NumericTexbox based on the AppThemeBinding as shown in the code snippet below .
Code Snippet :
<Style TargetType="syncfusion:SfNumericTextBox"> <Setter Property="BorderColor" Value="{AppThemeBinding Dark={StaticResource BorderDarkColor},Light={StaticResource BorderLightColor}}"/> <Setter Property="TextColor" Value="{AppThemeBinding Dark={StaticResource NumericDarkTextColor},Light={StaticResource NumericLightTextColor}}"/> </Style> |
To better understand the root cause and assist with resolving the issue, it would be helpful if you could provide more detailed information about the scenario in which our control was used, including a sample demonstrating the issue with replication steps. Additionally, we would like to know in which platform do you face this issue.
Kindly review the attached example and apply any required modifications to reproduce the problem. Afterward, kindly forward the sample to us, as it would enable us to conduct a more thorough investigation of the issue.
Regards,
Ahamed Ali Nishad.
Hi,
Thanks for your reply. As requested I have attached an updated version of your sample project, that now demonstrates the problem.
The major difference between your project and my project is that
Hi Paul,
Currently we are checking the reported query based on your provided sample and will let you know the details on July 24,2023. We appreciate your patience until then.
Regards,
Ahamed Ali Nishad
Hi Paul,
Currently, we are validating the reported query based on provided sample and will let you know the details on July 26, 2023. We appreciate your patience until then.
Regards,
Brundha V.
Hi Paul,
We have reviewed your query and checked the source code for the reported issue in the Android platform. On further analysis, we would like to inform you that, the numeric textbox input field class inherits from Native EditText and there is an issue with dynamic changes of theme in the Native EditText. We have prepared a workaround to resolve the issue in sample . In the modified sample, we have added the SfNumericTextBox in the Grid and set the backgroundColor property to the grid through styles based on the Dark Theme and Light Theme. We have attached the modified sample for your reference. Please get the attached sample and let us know if you need any other details.
Regards,
Ahamed Ali Nishad.
Hi,
Thanks for your reply and workaround, and apologies for my late response as I was on holiday.
I can confirm that your sample project with the workaround did work, though it did not have the same effect on my actual application when I tried the same as your reply implied was the workaround. So I identified the actual differences between the last 2 projects, and then manually reverted them until the problem re-occured.
The change made in your fixed project appeared to be:
Hi Paul,
You're Welcome. Please let us know if you have any further queries on this. We are happy to help.
Regards,
Preethi R