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.
Unfortunately, activation email could not send to your email. Please try again.

How to make SFTreeNavigator to look OK in Dark Theme?

Thread ID:

Created:

Updated:

Platform:

Replies:

131270 Jul 2,2017 02:36 PM Jul 7,2017 07:54 AM UWP 3
loading
Tags: SfTreeNavigator
Magnus Johansson
Asked On July 2, 2017 02:36 PM

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


Vijayalakshmi Roopkumar [Syncfusion]
Replied On July 3, 2017 08:46 AM

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.  


Magnus Johansson
Replied On July 3, 2017 04:05 PM

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

Vijayalakshmi Roopkumar [Syncfusion]
Replied On July 7, 2017 07:54 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;