SfPopup theme not updated when device theme changes

The theme of a visible SfPopup control is not updated when the host device's theme is changed.

I can reproduce this on an iPhone 11 simulator, with Xamarin.Forms 5.0.0.2196 and Syncfusion.Xamarin.SfPopupLayout 20.1.0.52.

I set up a sinle page Xamarin iOS project in Visual Studio for Mac 2022 Preview.

Code in App.xaml:









Code in App.xaml.cs:

public App ()
{
InitializeComponent();
SetupTheme();
Current.RequestedThemeChanged += (s, a) =>
{
SetupTheme();
};
MainPage = new MainPage();
}

[...]

private void SetupTheme()
{
ICollection mergedDictionaries = Resources.MergedDictionaries;
DarkTheme darkTheme = mergedDictionaries.OfType().FirstOrDefault();
LightTheme lightTheme = mergedDictionaries.OfType().FirstOrDefault();
OSAppTheme currentTheme = RequestedTheme;
if (currentTheme == OSAppTheme.Light)
{
_ = mergedDictionaries.Remove(darkTheme);
mergedDictionaries.Add(new LightTheme());
}
else
{
_ = mergedDictionaries.Remove(lightTheme);
mergedDictionaries.Add(new DarkTheme());
}
}


MainPage.xaml:






Apple
Orange
Pear









Code in MainPage.xaml.cs:

void ShowPopupButton_Clicked(System.Object sender, System.EventArgs e)
{
Popup.Show();
}

You wouldn't need the comboxbox, checkbox, or schedule controls, to recreate the scenario. I was testing these in dark mode as well.

When I change the theme using the simulator, all the controls rerender using the newly selected theme, except the popup, if it is currently visible. If the popup is closed and opened again, it renders correctly using the newly selected theme. If the popup isn't visible when the theme is changed, when I open it, it is rendered correctly using the newly selected theme.

Here is how this looks in the simulator with the popup open before a theme change. Everything is rendered in the light theme:

Before theme change.png


Andthisis after a theme change in the simulator, changing the theme to dark.All the controls rerender using the dark theme,except the popup:

After theme change.png


23 Replies

AN Anthony May 10, 2022 07:44 AM UTC

When I first submitted this issue, the code was correctly formatted, but the second image didn't appear.  After I edited it, a couple of the code blocks have been messed up.  Here's the code again from App.xaml:


<syncTheme:SyncfusionThemeDictionary>
            <syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
                <syncTheme:DarkTheme />
            </syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
        </syncTheme:SyncfusionThemeDictionary>


And from MainPage.xaml:


    <StackLayout VerticalOptions="FillAndExpand">
        <Label>SyncFusion Xamarin controls in light and dark theme</Label>
        <combobox:SfComboBox HeightRequest="40" x:Name="comboBox">
            <combobox:SfComboBox.ComboBoxSource>
                <ListCollection:List x:TypeArguments="x:String">
                    <x:String>Apple</x:String>
                    <x:String>Orange</x:String>
                    <x:String>Pear</x:String>
                </ListCollection:List>
            </combobox:SfComboBox.ComboBoxSource>
        </combobox:SfComboBox>
        <buttons:SfCheckBox x:Name="checkBox" IsChecked="True" Text="CheckBox"/>
        <buttons:SfButton x:Name="SfButton" Clicked="ShowPopupButton_Clicked" Text="Button"/>
        <syncfusion:SfSchedule x:Name="schedule" VerticalOptions="FillAndExpand"/>


        <sfPopup:SfPopupLayout x:Name="Popup" IsVisible="False"/>


    </StackLayout>


LN Lakshmi Natarajan Syncfusion Team May 11, 2022 02:30 PM UTC

Hi Anthony,


We could replicate reported scenario on our end. Currently, we are validating the same in our source level and will update you with further details in two business days (May 13, 2022). We appreciate your patience until then.


Regards,

Lakshmi Natarajan



AN Anthony May 12, 2022 12:03 AM UTC

Hello Lakshmi.  Thank you very much for looking into this and replicating the scenario.  I will wait to hear from you after the source has been looked at.  Thanks again.



SV Suja Venkatesan Syncfusion Team May 12, 2022 01:58 PM UTC

Hi Anthony,


As we promised in our previous update, we will update you with further details on or before May 13, 2022. We appreciate your patience and understanding.


Regards,

Suja



SV Suja Venkatesan Syncfusion Team May 15, 2022 04:58 PM UTC

Hi Anthony,


Currently, we are validating the reported scenario on our end. We will update you with further details on or before May 17, 2022. We appreciate your patience and understanding.


Regards,

Suja




AN Anthony May 17, 2022 03:50 AM UTC

Hello Suja.  Thank you for your last two updates.  I'm looking forward to hearing further details from you.



SV Suja Venkatesan Syncfusion Team May 17, 2022 06:04 PM UTC

Hi Anthony,


We regret to inform you that we need some more time to confirm the theme behavior of SfPopupLayout in development team. So, we need some more time to analyze the issue on our end. We will update you with further details on or before May 19,2022. We appreciate your patience and understanding.


Regards,

Suja



SV Suja Venkatesan Syncfusion Team May 19, 2022 02:39 PM UTC

Hi Anthony,


We have logged a bug repot for the reported issue “SfPopup theme not updated when device theme changes during runtime”. We will fix the issue and include the fix in our weekly nuget which is scheduled on June 14,2022. We will let you know once it is released with the fix. We appreciate your patience until then.

You can also track the status of the report from the below link.  

Feedback: https://www.syncfusion.com/feedback/34975/sfpopup-theme-not-updated-when-device-theme-changes-during-runtime


Regards,

Suja




AN Anthony May 20, 2022 01:51 AM UTC

Hello Suja, thank you for the updates, great news that there will be a fix.  I will keep an eye on the bug report.  Thanks again.



SV Suja Venkatesan Syncfusion Team May 22, 2022 05:21 PM UTC

Hi Anthony,


As we promised we will include the fix in our weekly nuget June 14,2022. We will let you know once the nuget released with fix. We appreciate your patience and understanding.


Regards,

Suja



SV Suja Venkatesan Syncfusion Team June 16, 2022 12:27 PM UTC

Hi Anthony,


We have fixed the reported issue “SfPopup theme not updated when device theme changes during runtime” and included the issue fix in our latest Weekly NuGet release update version 20.1.0.59 which is available for download (https://www.nuget.org/).   


We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance


Regards,

Suja



AN Anthony July 12, 2022 08:41 AM UTC

Thanks Suja, I appreciate the update.  I tested it with our app and found that it doesn't seem to have resolved the issue of the SfPopup theme not being updated when the device theme changes.  

Additionally, after the update, an open SfPopup control is now being closed when the device theme changes.

I have prepared and attached a Solution which you can use to hopefully reproduce the issues.

The original sample I provided in the issue description contains an empty SfPopup, but this appears to behave differently when the theme changes to an SfPopup that contains other controls, so in the attached Solution, the SfPopup contains two SfButton controls inside a StackLayout, which more closely matches the UI in the app I'm working on where I first encountered this issue.

I have updated all the SyncFusion libraries to the latest available version (20.2.0.36), along with Xamarin.Forms (5.0.0.2478), in the attached Solution.

I ran the attached Solution on a Mac running MacOS 12.3, in Simulator running an iPhone 8 plus.

To summarise the issues:

  • The SfPopup control, if open, is closed when the device theme changes (this started occurring in version 20.1.0.59)
  • When reopened after a theme change, the SfPopup is still rendered using the previously selected theme
  • After the SfPopup control is opened, closed, and then opened subsequent times, the text colour of the SfButton controls within the SfPopup is not rendered using the AppThemeBinding value assigned to the TextColor property.  I previously reported this issue separately, and it appears to be fixed in the specific scenario given in that issue, but when running the attached Solution, in which there are two buttons within the SfPopup control, the issue still occurs

Attachment: SFDM_b74ee0a9.zip


SV Suja Venkatesan Syncfusion Team July 13, 2022 03:05 PM UTC

Hi Anthony,


We would like to let you know that we are able to replicate the reported scenario on sample which you updated in previous update. Currently we are validating the reported issue on our end. We are need of some time to validate this issue in sample level. We will update you with further details on or before July 15, 2022. We appreciate your patience until then.


Regards,

Suja



AN Anthony July 14, 2022 05:18 AM UTC

Hello Suja. I'm happy to hear that you were able to replicate the issues, I'll wait to hear from you on the 15th.  Thank you.



SV Suja Venkatesan Syncfusion Team July 15, 2022 02:18 PM UTC

Hi Anthony,


Currently, we are checking the reported scenario with development team in our end. We will update you with further details on or before July 19, 2022. We appreciate your patience until then.


Regards,

Suja



SV Suja Venkatesan Syncfusion Team July 19, 2022 02:03 PM UTC

Hi Anthony,


We would like to let you know that the reported issues occurs when defining the SfPopupView in sample level. We are in need of two more business days to validate this issue by confirming some behavior on our end. We will update you with further details on or before July 21, 2022. We appreciate your patience until then.


Regards,

Suja



AN Anthony July 20, 2022 06:34 AM UTC

Hello Suja, thank you for the update.  I look forward to hearing from you again on the 21st, after you have had the opportunity to look into the issues further.  Thanks again.



SV Suja Venkatesan Syncfusion Team July 21, 2022 01:15 PM UTC

Hi Anthony,


We have logged an issue report for the issue “[iOS] SfPopupView appearance is not updated when change the theme at runtime”. We will fix the issue and include the fix in our next Weekly Nuget release update which is planned to roll out on August 16, 2022. We appreciate your patience until then.


You can track the status of this report through the following feedback link,

https://www.syncfusion.com/feedback/36498/ios-sfpopupview-appearance-is-not-updated-when-change-the-theme-at-runtime


Note: The feedback link provided is private, you need to login to view this feedback.


Regards,

Suja




SV Suja Venkatesan Syncfusion Team August 17, 2022 07:04 PM UTC

Hi Anthony,

We regret to inform you that we could not include the fix in our weekly nuget as promised. We are facing hurdles and analyzing possibilities to fix the problems. Also, We will fix the issue and include the fix in our 2022 Volume 3 Main release update which is planned to roll out on end of September. We appreciate your patience until then.

Regards,

Suja




SV Suja Venkatesan Syncfusion Team October 4, 2022 06:39 AM UTC

Hi Anthony,


We regret to inform you that we could not include the fix in our weekly nuget as promised. We will fix the issue and include the fix in our Weekly Nuget release update which is planned to roll out on October 11, 2022 . We appreciate your patience until then.


Regards,

Suja



SV Suja Venkatesan Syncfusion Team October 11, 2022 03:06 PM UTC

Hi Anthony,


We regret to inform you that we could not include the fix in our weekly nuget as promised. We have fixed the issue and we need time to ensure the fix with automation . So we will include the fix in our Weekly Nuget release update which is planned to roll out on October 18, 2022 . We appreciate your patience until then.


Regards,

Suja




SV Suja Venkatesan Syncfusion Team October 19, 2022 03:50 PM UTC

Hi Anthony,


We regret to inform you that we could not include the fix in our weekly nuget as promised. We have fixed the issue and we need time to ensure the fix with automation . So we will include the fix in our Weekly Nuget release update which is planned to roll out on October 25, 2022 . We appreciate your patience until then.


Regards,

Suja




SV Suja Venkatesan Syncfusion Team October 28, 2022 01:32 PM UTC

Hi Anthony,


We would like to let you know that when loading custom template to the ContentTemplate of SfPopupView, Please define the BackgroundColor and TextColor as like below code snippet


Code Snippet:

<sfPopup:SfPopupLayout.PopupView>
        <sfPopup:PopupView>
            <sfPopup:PopupView.ContentTemplate>
                <DataTemplate>
                    <Label Text="This is the Customized view for SfPopupLayout"
                           BackgroundColor="{DynamicResource SfPopupLayoutHeaderBackgroundColor}"
                            TextColor="{DynamicResource SfPopupLayoutHeaderTextColor}"

                           HorizontalTextAlignment="Center"/>
                </DataTemplate>
            </sfPopup:PopupView.ContentTemplate>
        </sfPopup:PopupView>
    </sfPopup:SfPopupLayout.PopupView>


And also, we have fixed the reported issue “[iOS] SfPopupView appearance is not updated when change the theme at runtime” and included the issue fix in our latest NuGet release update version 20.3.0.52 which is available for download (https://www.nuget.org/).   


We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.


Regards,

Suja


Loader.
Up arrow icon