TitleBar of a Window based on a subclass doesn't have the Theme colors.

Hi all,

unfortunately when I try to apply a theme to a window that is child of a base class and that uses generics, the theme is not applied to the title bar.

So, for a normal window, I get the following:


While for the subclass window I get this:


I will attach my code, so that you can take a look.

Thank you very much in advance.

Attachment: DemaDMS_5e6512af.7z

12 Replies

LD Luca De Marco September 13, 2020 09:24 PM UTC

I am sorry...

I forgot to tell you how to show the windows:

For the correct one press F11 from the main window.
For the wrong one press CTRL+N from the main window.

Thanks in advance,
Luca


VR Vijayalakshmi Roopkumar Syncfusion Team September 14, 2020 05:13 PM UTC

Hi Nikolay 
 
Thank you for contacting Syncfusion Support. 
 
We have checked the reported behavior that Titlebar style of ChromelessWindow does not apply properly on using the custom class derived from ChromelessWindow. Since the visual style would not apply properly for the derived window , and we need to apply it by using the style property and referred the key explicitly. Please find the below code for the same. 
 
Code:[XAML] 
 
 
<ui:WndCollectionsBase 
x:Class="UI.WndDemaDocuments" 
x:TypeArguments="business:DemaDocument" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:business="clr-namespace:BusinessObjects;assembly=BusinessObjects" 
xmlns:ui="clr-namespace:UI" 
mc:Ignorable="d" Style="{DynamicResource SyncfusionChromelessWindowStyle}" 
Title="Documents" Height="620" Width="850" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"> 
 
 
 
However this case works in simple sample, but however in your application it working only on setting the visual style in MainWindow.cs constructor .  We suspect , there might be wrong in theme invoking in your application, so we are currently checking your application to work with your theme settings. However meanwhile, please check the below modified sample : 
 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



VR Vijayalakshmi Roopkumar Syncfusion Team September 14, 2020 05:14 PM UTC

Hi Luca 
 
Please ignore previous updates. 
 
Thank you for contacting Syncfusion Support. 
 
We have checked the reported behavior that Titlebar style of ChromelessWindow does not apply properly on using the custom class derived from ChromelessWindow. Since the visual style would not apply properly for the derived window , and we need to apply it by using the style property and referred the key explicitly.  
 
Code:[XAML] 
 
 
<ui:WndCollectionsBase 
x:Class="UI.WndDemaDocuments" 
x:TypeArguments="business:DemaDocument" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:business="clr-namespace:BusinessObjects;assembly=BusinessObjects" 
xmlns:ui="clr-namespace:UI" 
mc:Ignorable="d" Style="{DynamicResource SyncfusionChromelessWindowStyle}" 
Title="Documents" Height="620" Width="850" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"> 
 
 
 
However this case works in simple sample, but however in your application it working only on setting the visual style in MainWindow.cs constructor .  We suspect , there might be wrong in theme invoking in your application, so we are currently checking your application to work with your theme settings. However meanwhile, please check the below modified sample : 
 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



LD Luca De Marco September 20, 2020 07:06 AM UTC

Hi,

sorry for the late reply, but it has been one hell of a week...

I tried to run your sample, but I get the following results:

If I press F11 I get the following window:


If I press CTRL+N I get the following:


It seems your change solved the derived problem, but somehow the other window doesn't work any more :(

I also tried to apply your suggestion to my app, but it doesn't work. What I mean is that F11 works but CTRL+N doesn't.

Let me know if you need more details from me.

Thank you in advance,
Luca


VR Vijayalakshmi Roopkumar Syncfusion Team September 21, 2020 02:18 PM UTC

Hi Luca, 
 
Thank you for your update. 
 
We were able to reproduce this behavior using the sample. However, we are currently validating this behavior and provide you complete details by 23rd Sep, 2020. 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



VR Vijayalakshmi Roopkumar Syncfusion Team September 23, 2020 01:14 PM UTC

Hi Luca, 
 
Thank you for your patience. 
 
Query :  It seems your change solved the derived problem, but somehow the other window doesn't work any more :(also tried to apply your suggestion to my app, but it doesn't work. What I mean is that F11 works but CTRL+N doesn't. 
 
We have checked the reported behaviour that theme does not apply for the  window name “Impostazioni” in your app  . As per ChromelessWindow, the style would apply properly for sub windows only by setting the style explicitly for SfSkinManager themes. 
 
Code: WndSettings.xaml 
 
 
<sf:ChromelessWindow 
x:Class="UI.WndSettings" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:local="clr-namespace:UI" 
xmlns:sf="http://schemas.syncfusion.com/wpf" 
xmlns:ui="clr-namespace:UI;assembly=UI" 
mc:Ignorable="d" 
Style="{DynamicResource SyncfusionChromelessWindowStyle}" 
Title="{DynamicResource SettingsString}" Height="500" Width="800" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"> 
 
 
Screenshot: 
 
F11 => Impostazioni Window 
 
 
 
Ctrl + N => NewWindow 
 
 
 
Now the theme applied for both windows, so can you check the modified sample and let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 
  



LD Luca De Marco September 24, 2020 02:23 PM UTC

Hi,

I tried your sample and it works correctly, but on my app it doesn't: Pressing CTRL+N shows the wrong titlebar.

I know I am asking too much (probably), but.... can I send you the whole application so you can tell me if you are able to replicate the issue?

If you say yes, the files I upload here are visible to everyone or only to you?

Thanks in advance,
Luca


VR Vijayalakshmi Roopkumar Syncfusion Team September 25, 2020 07:08 AM UTC

Hi Luca, 
 
Thank you for your update. 
 
Query : can I send you the whole application so you can tell me if you are able to replicate the issue?If you say yes, the files I upload here are visible to everyone or only to you? 
 
Yes, please send your application to [email protected], to restrict the file visiblity to public.  
 
We will check your application and provide you the details upon on this. 
 
Please let us know if you have any other concern. 
 
Regards, 
Vijayalakshmi VR 



LD Luca De Marco September 25, 2020 09:19 AM UTC

Thank you very much for your response!

I have sent an email to [email protected] with the following title:

Full Application code for community forum post 157806


I must say that our customare care is really the best out there!!!


Kind Regards,

Luca



VR Vijayalakshmi Roopkumar Syncfusion Team September 28, 2020 12:28 PM UTC

Hi Luca, 
 
Thank you for your update. 
 
We would able to replicate the reported scenario with your application, we have forwarded this to our development team and they are currently validating it. We will check and update you the details by tomorrow[29th Sep, 2020] 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



VR Vijayalakshmi Roopkumar Syncfusion Team September 29, 2020 03:08 PM UTC

Hi Luca, 
 
Thanks for your patience.  
 
We have checked the reported query in your application and noted that you have set the style for the windows in ThemeManager.cs and set the ApplyStylesOnApplication as True in App.xaml.cs. On analyzing we have noted that when the Application is run initially, the theme for the main window is set in ThemeManager.cs and then the style for the child window is also set when the child window is opened. When ApplyStylesOnApplication is set, the theme for the main window alone can be set as the styles for the controls will be merged in the Application’s resources itself and there is no need to set the theme for the child window separately. However as mentioned in our earlier update, we need to set the Style property for the child window. We have modified the application by setting the Style property for child windows as mentioned in our earlier update and also set the theme for the MainWindow alone by checking whether the window is Application’s MainWindow. Please find the code snippet and screenshots below:  
 
We will update the modified application shortly via mail.  
 
Code snippet: 
 
public void AddWindow(Window wnd) 
{ 
       foreach (Window temp in windows) 
       { 
              if (temp == wnd) 
                     return; 
       } 
 
       windows.RemoveAll (x => x == null); 
       windows.RemoveAll (x => x.IsLoaded == false); 
 
       windows.Add (wnd); 
 
       // Setting VisualStyle for main window alone as ApplyStylesOnApplication is set. 
    if (wnd == Application.Current.MainWindow) 
        SfSkinManager.SetVisualStyle(wnd, CurrentTheme); 
} 
 
 
Main Window:  
 
 
Child Window 1 (File à Nuovo Documento) : 
 
 
 
Child Window 2(Utilia à Impostazioni) :  
 
 
 
Child Window 3(Utilia à Eticchette) :  
 
 
 
Please check and let us know whether it resolves the reported query.  
 
Regards, 
Vijayalakshmi VR 




VR Vijayalakshmi Roopkumar Syncfusion Team September 30, 2020 08:02 AM UTC

Hi Luca, 
 
We have update the modified application in the incident, which has been created under your account.  
 
Please try it and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 


Loader.
Up arrow icon