We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to make SFTreeNavigator to look OK in Dark Theme?

I am developing an app that should use the default Dark Theme.
I am using the latest v15.2.0.40.

However, when I switch to the Dark Theme ( in the Syncfusion Sample UWP.Navigation):

<Application
    x:Class="Syncfusion.SampleBrowser.UWP.Navigation.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Syncfusion.SampleBrowser.UWP.Navigation"
    RequestedTheme="Dark">
</Application>


It looks awful:


How ca I make the SFTreeNavigation look good in Dark theme?

Thanks.
/M


3 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team July 3, 2017 12:46 PM UTC

Hi Magnus

Thank you for contacting Syncfusion Support.

Could you please let us know whether you want to set the Requested Theme in UWP Sample Browser application or SfTreeNavigator control? If you need to set the RequestedTheme in Sample Browser, at present there is no support for this requirement. But if you would like to apply RequestedTheme for SfTreeNavigator control, then it can be done. We have prepared the sample and source for your reference. 
Code Example: 
APP.XAML 
<Application 
    x:Class="TreeNavigatorRequestedTheme.App" 
    xmlns:local="using:TreeNavigatorRequestedTheme" 
    RequestedTheme="Dark"> 
</Application> 
 
 
 
 
MainPage.XAML 
 
<Page.DataContext> 
 
<local:TreeViewModel></local:TreeViewModel> 
</Page.DataContext> 
 
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
<navigation:SfTreeNavigator ItemsSource="{Binding Models}" Width="500"> 
 
<navigation:SfTreeNavigator.ItemTemplate> 
 
<primitives:HierarchicalDataTemplate ItemsSource="{Binding Models}"> 
 
<DataTemplate> 
 
<TextBlock Text="{Binding Header}"/> 
 
</DataTemplate> 
 
</primitives:HierarchicalDataTemplate> 
 
</navigation:SfTreeNavigator.ItemTemplate> 
 
</navigation:SfTreeNavigator> 
 
</Grid> 
 
 
 
Screenshot: 
  
Please check this sample and let us know if it helps you. Otherwise, if we have misunderstood your query kindly guide us with necessary details.

Regards,
Vijayalakshmi V.R.  



MJ Magnus Johansson July 3, 2017 08:05 PM UTC

Hi,

thanks. 

The problem I have now is when switching themes dynamically.

The concept is from the Microsoft Template Studio , where one can easily switch between the Dark and Light theme on the fly.

I have tried to make the SfTreeNavigator to adhere to that, but to no avail.

Attached is a simple sample, a SfTreeNavigator is placed on the BlankPage.xaml (the very same as in the sample you provided).

In the BlankPage.xaml.cs, I subscribe to the  ThemeSelectorService.OnThemeChanged event:

   private void ThemeSelectorService_OnThemeChanged(object sender, Windows.UI.Xaml.ElementTheme e)

        {

            treeNavigator.RequestedTheme = e;

        }


But it doesn't switch the theme.


Any ideas?

Thanks,

Magnus


Attachment: TreeNavigatorThemeTest_35866550.zip


VR Vijayalakshmi Roopkumar Syncfusion Team July 7, 2017 11:54 AM UTC

Hi Magnus

Thank you for the patience.

At present, SfTreeNavigator does not support the reported requirement. A support incident to track the status of this has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Please let me know if you have any questions.

Regards,
Vijayalakshmi V.R. 


Loader.
Up arrow icon