Kaziem
Topic Author
Posts: 5
Joined: 03 Oct 2023, 12:02

Issue with Texture Atlas

07 Oct 2023, 02:41

Hello.
Working on getting my first view to render correctly.
I have a set of kind of confusing outcomes I can't quit explain/make sense of.
I am brand new to Noesis but an experience developer.
Image
The Problem: My buttons are rendering as magenta blocks with no text in them.

Background:
  • I have made a couple minor local changes to support subclassing the "GameWithNeosis" class.
  • The issue seems to only effect the buttons. Not the static images/image control.
Code:
	<!-- Created using Noesis XAML exporter for TexturePacker (https://www.codeandweb.com/texturepacker) -->
<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <BitmapImage x:Key="GUICoreImages" UriSource="GUICoreImages.png"/>
  <CroppedBitmap x:Key="PanelGreen" Source="{StaticResource GUICoreImages}" SourceRect="1,1,822,1009"/>
  <CroppedBitmap x:Key="VerticalPanelBordered" Source="{StaticResource GUICoreImages}" SourceRect="825,1,264,1440"/>
  <CroppedBitmap x:Key="VerticalPanel" Source="{StaticResource GUICoreImages}" SourceRect="1091,1,158,1440"/>
  <CroppedBitmap x:Key="PanelGreenWithFooter" Source="{StaticResource GUICoreImages}" SourceRect="1,1012,489,582"/>
  <CroppedBitmap x:Key="CoOpStudioLogo" Source="{StaticResource GUICoreImages}" SourceRect="1251,1,256,256"/>
  <CroppedBitmap x:Key="FullLogo" Source="{StaticResource GUICoreImages}" SourceRect="1251,259,256,256"/>
  <CroppedBitmap x:Key="SyndicatesLogo" Source="{StaticResource GUICoreImages}" SourceRect="1251,517,256,256"/>
  <CroppedBitmap x:Key="SynLogo" Source="{StaticResource GUICoreImages}" SourceRect="1251,775,256,256"/>
  <CroppedBitmap x:Key="PanelBlack" Source="{StaticResource GUICoreImages}" SourceRect="1,1596,588,252"/>
  <CroppedBitmap x:Key="SelectorGreen" Source="{StaticResource GUICoreImages}" SourceRect="1,1850,886,185"/>
  <CroppedBitmap x:Key="TooltipBackground" Source="{StaticResource GUICoreImages}" SourceRect="492,1012,287,386"/>
  <CroppedBitmap x:Key="PanelGreenLargeTitle" Source="{StaticResource GUICoreImages}" SourceRect="591,1443,800,243"/>
  <CroppedBitmap x:Key="ListItemBackground" Source="{StaticResource GUICoreImages}" SourceRect="591,1688,631,58"/>
  <CroppedBitmap x:Key="IconPanel" Source="{StaticResource GUICoreImages}" SourceRect="591,1748,529,92"/>
  <CroppedBitmap x:Key="Separator" Source="{StaticResource GUICoreImages}" SourceRect="591,1842,334,1"/>
  <CroppedBitmap x:Key="ProgressBarBackground" Source="{StaticResource GUICoreImages}" SourceRect="492,1400,325,10"/>
  <CroppedBitmap x:Key="BoxBlue" Source="{StaticResource GUICoreImages}" SourceRect="1251,1033,132,110"/>
  <CroppedBitmap x:Key="BoxGrey" Source="{StaticResource GUICoreImages}" SourceRect="1251,1145,132,110"/>
  <CroppedBitmap x:Key="ButtonActiveRound" Source="{StaticResource GUICoreImages}" SourceRect="1224,1688,162,58"/>
  <CroppedBitmap x:Key="ButtonHoverRound" Source="{StaticResource GUICoreImages}" SourceRect="1122,1748,162,58"/>
  <CroppedBitmap x:Key="SeparatorVertical" Source="{StaticResource GUICoreImages}" SourceRect="781,1012,3,205"/>
  <CroppedBitmap x:Key="SlideBar" Source="{StaticResource GUICoreImages}" SourceRect="492,1412,191,14"/>
  <CroppedBitmap x:Key="ButtonActive" Source="{StaticResource GUICoreImages}" SourceRect="1122,1808,162,39"/>
  <CroppedBitmap x:Key="ScrollBarBackground" Source="{StaticResource GUICoreImages}" SourceRect="1393,1033,17,586"/>
  <CroppedBitmap x:Key="ButtonHover" Source="{StaticResource GUICoreImages}" SourceRect="927,1842,162,39"/>
  <CroppedBitmap x:Key="ButtonNormalRound" Source="{StaticResource GUICoreImages}" SourceRect="889,1883,162,58"/>
  <CroppedBitmap x:Key="ButtonNormal" Source="{StaticResource GUICoreImages}" SourceRect="889,1943,162,39"/>
  <CroppedBitmap x:Key="ProgressBarForeground" Source="{StaticResource GUICoreImages}" SourceRect="492,1428,128,10"/>
  <CroppedBitmap x:Key="ItemCell" Source="{StaticResource GUICoreImages}" SourceRect="1286,1748,62,62"/>
  <CroppedBitmap x:Key="CheckboxBackground" Source="{StaticResource GUICoreImages}" SourceRect="1412,1033,48,48"/>
  <CroppedBitmap x:Key="ScrollBarHandle" Source="{StaticResource GUICoreImages}" SourceRect="786,1012,17,64"/>
  <CroppedBitmap x:Key="CheckboxChecked" Source="{StaticResource GUICoreImages}" SourceRect="1251,1257,40,40"/>
  <CroppedBitmap x:Key="CheckboxUnchecked" Source="{StaticResource GUICoreImages}" SourceRect="889,1984,40,40"/>
  <CroppedBitmap x:Key="MinusButton" Source="{StaticResource GUICoreImages}" SourceRect="492,1440,38,38"/>
  <CroppedBitmap x:Key="PlusButton" Source="{StaticResource GUICoreImages}" SourceRect="1412,1083,38,38"/>
  <CroppedBitmap x:Key="StatusBlank" Source="{StaticResource GUICoreImages}" SourceRect="685,1412,29,29"/>
  <CroppedBitmap x:Key="StatusGreen" Source="{StaticResource GUICoreImages}" SourceRect="716,1412,29,29"/>
  <CroppedBitmap x:Key="StatusRed" Source="{StaticResource GUICoreImages}" SourceRect="747,1412,29,29"/>
  <CroppedBitmap x:Key="Slider" Source="{StaticResource GUICoreImages}" SourceRect="1091,1842,29,14"/>
  <CroppedBitmap x:Key="Cursor" Source="{StaticResource GUICoreImages}" SourceRect="1053,1883,24,24"/>
  <CroppedBitmap x:Key="ArrowLeft" Source="{StaticResource GUICoreImages}" SourceRect="1393,1621,15,30"/>
  <CroppedBitmap x:Key="ArrowRight" Source="{StaticResource GUICoreImages}" SourceRect="1286,1812,15,30"/>
  <CroppedBitmap x:Key="Checkmark" Source="{StaticResource GUICoreImages}" SourceRect="1350,1748,16,14"/>
  <CroppedBitmap x:Key="XMark" Source="{StaticResource GUICoreImages}" SourceRect="1462,1033,14,14"/>

</ResourceDictionary>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Images/GUICoreImages.xaml"/>
        <ResourceDictionary Source="Fonts/Fonts.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <SolidColorBrush x:Key="MidGrey" Color="#606060"/>
    <SolidColorBrush x:Key="DarkGrey" Color="#333"/>
    <SolidColorBrush x:Key="SynBlue" Color="#25aae1"/>
    <SolidColorBrush x:Key="SynOrange" Color="#da6f35"/>
    <SolidColorBrush x:Key="SynGreen" Color="#32f220"/>

    <Style x:Key="XlButtonNormal" TargetType="Button">
        <Setter Property="Background">
            <Setter.Value>
                <ImageBrush ImageSource="{DynamicResource ButtonNormal}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Padding">
            <Setter.Value>
                <Thickness Top="10" Bottom="10" Left="90" Right="90"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Margin">
            <Setter.Value>
                <Thickness Top="0" Bottom="25" Left="0" Right="0"/>
            </Setter.Value>
        </Setter>
        <Setter Property="FontFamily" Value="{StaticResource SyncopateBold}" />
        <Setter Property="FontSize" Value="20" />
    </Style>

</ResourceDictionary>
<Window x:Name="MainMenuWindow" x:Class="SyndicatesGUI.MainMenu.MainMenu"
        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:SyndicatesGUI.MainMenu"
        mc:Ignorable="d"
        Title="MainMenu" Height="1080" Width="1920" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Background="{x:Null}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Assets/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Center">
        <Image x:Name="Logo" Height="200" Width="200" Source="{StaticResource FullLogo}" />

        <Button x:Name="ContinueButton" Style="{DynamicResource XlButtonNormal}" Content="Continue"/>
        <Button x:Name="NewGameButton" Style="{StaticResource XlButtonNormal}" Content="New Game"/>
        <Button x:Name="LoadGameButton" Style="{StaticResource XlButtonNormal}" Content="Load Game"/>
        <Button x:Name="ConfigurationButton" Style="{StaticResource XlButtonNormal}" Content="Configuration"/>
        <Button x:Name="ExitButton" Style="{StaticResource XlButtonNormal}" Content="Exit"/>
    </StackPanel>
</Window>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <FontFamily x:Key="DosisRegular">#Dosis Regular</FontFamily>
    <FontFamily x:Key="DosisBold">#Dosis Bold</FontFamily>
    <FontFamily x:Key="OrbitronRegular">#Orbitron Regular</FontFamily>
    <FontFamily x:Key="OrbitronBold">#Orbitron Bold</FontFamily>
    <FontFamily x:Key="SyncopateNormal">#Syncopate Regular</FontFamily>
    <FontFamily x:Key="SyncopateBold">#Syncopate Bold</FontFamily>
</ResourceDictionary>
Any help would be appreciated, and feel free to ask for any more information you need.
 
Kaziem
Topic Author
Posts: 5
Joined: 03 Oct 2023, 12:02

Re: Issue with Texture Atlas

07 Oct 2023, 21:15

I found a post suggesting I need to add a built in theme and that this was the debug theme.
Once I added the theme files the buttons with the style I used were still broken.
When I removed the style they look like the picture below:
Image

It does not contain the text or seem to have any functionality (no hover/click etc.)

The new code for the view is:
<Window x:Name="MainMenuWindow" x:Class="SyndicatesGUI.MainMenu.MainMenu"
        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:SyndicatesGUI.MainMenu"
        mc:Ignorable="d"
        Title="MainMenu" Height="1080" Width="1920" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Background="{x:Null}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Assets/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Center">
        <Image x:Name="Logo" Height="200" Width="200" Source="{StaticResource FullLogo}" />
        <!--Style="{StaticResource XlButtonNormal}"-->
        <Button x:Name="ContinueButton"  Content="Continue"/>
        <Button x:Name="NewGameButton" Content="New Game"/>
        <Button x:Name="LoadGameButton" Content="Load Game"/>
        <Button x:Name="ConfigurationButton" Content="Configuration"/>
        <Button x:Name="ExitButton" Content="Exit"/>
    </StackPanel>
</Window>
Correct me if I'm wrong but shouldn't this show the names (the content attribute) in green on the buttons given I've skipped my style and am relying on the theme?

The call made to load the theme is in this block (which is part of the Neosis.MonoGame project)
public void InitializeNoesis()
    {
        // ensure the Noesis.App assembly is loaded otherwise NoesisGUI will be unable to located "Window" type
        System.Reflection.Assembly.Load("Noesis.App");

        // setup Noesis Debug callbacks
        Log.SetLogCallback(NoesisLogCallbackHandler);
        Error.SetUnhandledCallback(NoesisUnhandledExceptionHandler);

        GUI.SetLicense(NoesisLicenceName, NoesisLicenceKey);
        GUI.Init();

        GUI.SetFontProvider(new FolderFontProvider());
        GUI.SetTextureProvider(new FolderTextureProvider(GraphicsDevice));
        GUI.SetXamlProvider(new FolderXamlProvider());
        
        if(NoesisThemeFilename is not null)
        {
            GUI.LoadApplicationResources(NoesisThemeFilename.Replace('/', '\\'));
        }

        if (NoesisMainViewFilename is not null)
        {
            FrameworkElement controlTreeRoot = (FrameworkElement)GUI.LoadXaml(NoesisMainViewFilename);

            NoesisRenderDevice renderDevice = new(GraphicsDevice, Content, _loggerFactory);

            // TODO: increased to deal with the glyph cache crash - refactor to move to NoesisConfig
            renderDevice.GlyphCacheWidth = renderDevice.GlyphCacheHeight = 4096;
            renderDevice.OffscreenSampleCount = NoesisAntiAlliasingOffscreenSampleCount;

            MainView = new NoesisViewWrapper(controlTreeRoot, renderDevice)
            {
                RenderFlags = RenderFlags.LCD | RenderFlags.PPAA
            };

            MainView.SetSize(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
        }

        Window.KeyDown += (sender, e) => { MainView.View.KeyDown(KeyConverter.Convert(e.Key)); };
        Window.KeyUp += (sender, e) => { MainView.View.KeyUp(KeyConverter.Convert(e.Key)); };
        Window.TextInput += (sender, e) => { MainView.View.Char(e.Character); };
    }
 
Kaziem
Topic Author
Posts: 5
Joined: 03 Oct 2023, 12:02

Re: Issue with Texture Atlas

08 Oct 2023, 00:30

Fixing it bit by bit - will include what was wrong for anyone finding this:
  • Fonts were improperly named and referenced.
  • Styles were missing BasedOn to get the theme underneath.
  • Add window resize handler to MonoGame Window to reset size of the view.
Fonts
    <FontFamily x:Key="Dosis">Fonts/ #Dosis</FontFamily>
    <FontFamily x:Key="Orbitron">Fonts/ #Orbitron</FontFamily>
    <FontFamily x:Key="Syncopate">Fonts/ #Syncopate</FontFamily>
Style change
<Style x:Key="XlButtonNormal" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
Window Resize Handler
_graphicsDeviceManager.GraphicsDevice.DeviceReset += (sender, e) => { MainView.View.SetSize(Window.ClientBounds.Width, Window.ClientBounds.Height); };
There are still many issues continuing to work through them.
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Issue with Texture Atlas

10 Oct 2023, 20:13

Sorry for the late reply, it seems you already found the explanation for all the initial problems.

Just to add some links to backup your findings:
Fonts were improperly named and referenced.
https://www.noesisengine.com/docs/Gui.C ... ont-family
Styles were missing BasedOn to get the theme underneath.
https://www.noesisengine.com/docs/Gui.C ... cal-styles
Add window resize handler to MonoGame Window to reset size of the view.
This is basically required to indicate to the Noesis View the size of the surface where UI elements will be arranged and rendered. This should be done by the integration code that handles the operating system windows. In our application framework we expose a Display class (that has implementations for each platform) that takes care of this.
here are still many issues continuing to work through them.
Please let us know if we can help with any of this issues.
 
Kaziem
Topic Author
Posts: 5
Joined: 03 Oct 2023, 12:02

Re: Issue with Texture Atlas

12 Oct 2023, 05:24

Thanks for the reply - I appreciate the backing docs quite a bit actually.
The only issue I have now is that the images don't want to be overridden in the style.
<Window x:Name="MainMenuWindow" x:Class="SyndicatesGUI.MainMenu.MainMenu"
        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:SyndicatesGUI.MainMenu"
        mc:Ignorable="d"
        Title="MainMenu" Height="1080" Width="1920" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Background="{x:Null}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Assets/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Center">
        <Image x:Name="Logo" Height="500" Width="500" Source="{StaticResource  FullLogo}" />
        <!--Style="{StaticResource XlButtonNormal}"-->
        <Button x:Name="ContinueButton" Style="{StaticResource XlButtonNormal}" Content="Continue"/>
        <Button x:Name="NewGameButton" Style="{StaticResource XlButtonNormal}" Content="New Game"/>
        <Button x:Name="LoadGameButton" Style="{StaticResource XlButtonNormal}" Content="Load Game"/>
        <Button x:Name="ConfigurationButton" Style="{StaticResource XlButtonNormal}" Content="Configuration"/>
        <Button x:Name="ExitButton" Style="{StaticResource XlButtonNormal}" Content="Exit" Click="ExitButtonClickHandler"/>
    </StackPanel>
</Window>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Theme/NoesisTheme.DarkPurple.xaml"/>
        <ResourceDictionary Source="Fonts.xaml"/>
        <ResourceDictionary Source="Images.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <SolidColorBrush x:Key="MidGrey" Color="#606060"/>
    <SolidColorBrush x:Key="DarkGrey" Color="#333"/>
    <SolidColorBrush x:Key="SynBlue" Color="#25aae1"/>
    <SolidColorBrush x:Key="SynOrange" Color="#da6f35"/>
    <SolidColorBrush x:Key="SynGreen" Color="#32f220"/>
    
    <ControlTemplate x:Key="XlButtonTemplate" TargetType="{x:Type Button}">
        <Button x:Name="Button"
                Background="{TemplateBinding Background}"
                BorderBrush="LightBlue"
                BorderThickness="0">
            <ContentPresenter Margin="{TemplateBinding Padding}"/>
        </Button>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="Button" Property="Background">
                    <Setter.Value>
                        <ImageBrush ImageSource="{StaticResource ButtonHover}"></ImageBrush>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="Button" Property="Background">
                    <Setter.Value>
                        <ImageBrush ImageSource="{StaticResource ButtonActive}"></ImageBrush>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    
    <!-- BasedOn="{StaticResource {x:Type Button}}" -->
    <Style x:Key="XlButtonNormal" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
        <Style.Setters>
            <Setter Property="Template" Value="{StaticResource XlButtonTemplate}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Background">
                <Setter.Value>
                    <!-- <SolidColorBrush Color="Chartreuse"/> -->
                    <ImageBrush ImageSource="{StaticResource ButtonActiveRound}" Stretch="Fill" />
                </Setter.Value>
            </Setter>
            <Setter Property="Padding">
                <Setter.Value>
                    <Thickness Top="20" Bottom="20" Left="90" Right="90"/>
                </Setter.Value>
            </Setter>
            <Setter Property="Margin">
                <Setter.Value>
                    <Thickness Top="0" Bottom="20" Left="0" Right="0"/>
                </Setter.Value>
            </Setter>
            <Setter Property="FontFamily" Value="{StaticResource Orbitron}" />
            <Setter Property="FontSize" Value="14" />
        </Style.Setters>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="BorderBrush" Value="Chartreuse"></Setter>
                <Setter Property="Background">
                    <Setter.Value>
                        <!-- <SolidColorBrush Color="Purple"/> -->
                        <ImageBrush ImageSource="{DynamicResource ButtonHoverRound}" Stretch="Fill"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="Background">
                    <Setter.Value>
                        <!-- <SolidColorBrush Color="Peru"/> -->
                        <ImageBrush ImageSource="{StaticResource ButtonActive}" Stretch="Fill"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>
Output of the above:
https://imgur.com/a/bRK2Zz5
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Issue with Texture Atlas

17 Oct 2023, 19:22

Hi, you are using a Button to define the ControlTemplate of a Button, that doesn't seem what you really want to do, right?

Instead you should define how a Button looks like by using other simpler elements (Panels, Borders, Shapes, ContentPresenter...):
    <ControlTemplate x:Key="XlButtonTemplate" TargetType="{x:Type Button}">
      <Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="LightBlue" BorderThickness="0">
        <ContentPresenter Margin="{TemplateBinding Padding}"/>
      </Border>
      <ControlTemplate.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
          <Setter TargetName="bd" Property="Background" Value="{StaticResource SynOrange}"/>
        </Trigger>
        <Trigger Property="IsPressed" Value="True">
          <Setter TargetName="bd" Property="Background" Value="{StaticResource SynBlue}"/>
        </Trigger>
      </ControlTemplate.Triggers>
    </ControlTemplate>
And also you are defining triggers for both the ControlTemplate and the Style for the same properties. This makes no sense, as the template triggers have more priority and the style ones will be ignored. I recommend you just use the template triggers in this case to set all the properties.

It would be useful to use triggers in the Style and not in the template if you wanted to share the same template definition, and create several styles with different triggers.

Who is online

Users browsing this forum: No registered users and 7 guests