}

...and define the default style in a ResourceDictionary called Generic.xaml in a folder called Themes at the root of the project in which the custom control class is defined:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Navigation="clr-namespace:WpfApplication3">

    <Style TargetType="Navigation:HtNavigationMenuCategoryItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Navigation:HtNavigationMenuCategoryItem">
                    <Grid Margin="10,10,10,0">
                        <StackPanel Orientation="Vertical" Background="Yellow">
                            <TextBlock>...</TextBlock>
                            <ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CategoryItems}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Orientation="Vertical"/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                    <TextBlock Text="{Binding}" />
                                </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

This works as far as the Style and ControlTemplate are involved.

Actually I have the "Style working" solution with a second separate Style called "HtNavigationMenuCategoryItemSingle". But I want to know if it is possible or HOW I can override this Style in the ItemsControl like I was trying in the "Style not working" solution...

I guess you could just define the ItemContainerStyle inline:
<Style TargetType="Navigation:HtNavigationMenuCategoryItem">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Navigation:HtNavigationMenuCategoryItem">
                <Grid Margin="10,10,10,0">
                    
} 

... and define the default style in a ResourceDictionary called Generic.xaml in a booklet call Themes at the root of the project in which the customs control course is defined: 
 < ResourceDictionary xmlns="http://schemas.microsoft.com / winfx/2006 / xaml / presentation " 
                     xmlns: x="http://schemas.microsoft.com / winfx/2006 / xaml " 
                     xmlns: Navigation="clr - namespace: WpfApplication3 " > 

     < Style TargetType="Navigation: HtNavigationMenuCategoryItem " > 
         < Setter Property="Template " > 
             < Setter. Value > 
                 < ControlTemplate TargetType="Navigation: HtNavigationMenuCategoryItem " > 
                     < Grid Margin="10,10,10,0 " > 
                         < StackPanel Orientation="Vertical " Background="Yellow " > 
                             < TextBlock>... </TextBlock > 
                             < ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent }, Path = CategoryItems } " > 
                                 < ItemsControl. ItemsPanel > 
                                     < ItemsPanelTemplate > 
                                         < StackPanel Orientation="Vertical"/ > 
                                     < /ItemsPanelTemplate > 
                                 < /ItemsControl. ItemsPanel > 
                                 < ItemsControl. ItemTemplate > 
                                     < DataTemplate > 
                                     < TextBlock Text="{Binding } " / > 
                                 < /DataTemplate > 
                                 < /ItemsControl. ItemTemplate > 
                             < /ItemsControl > 
                         < /StackPanel > 
                     < /Grid > 
                 < /ControlTemplate > 
             < /Setter. Value > 
         < /Setter > 
     < /Style > 

 < /ResourceDictionary > 

 This work as far as the Style and ControlTemplate are involved. 

 Actually I suffer the " Style working " solution with a second separate Style call " HtNavigationMenuCategoryItemSingle ". But I want to know if it is potential or HOW I can override this Style in the ItemsControl like I was trying in the " Style not working " solution... 

 I guess you could just define the ItemContainerStyle inline: 
 < Style TargetType="Navigation: HtNavigationMenuCategoryItem " > 
     < Setter Property="Template " > 
         < Setter. Value > 
             < ControlTemplate TargetType="Navigation: HtNavigationMenuCategoryItem " > 
                 < Grid Margin="10,10,10,0 " >
}

...and define the default stylt in a ResourceDierionarb calles Generiz.xaml in a folder called Thelew at uke root of the projezt in whibh the cuwtom xontrol cleas is dcyined:
<DcsoureeVictionary xmlnx="http://schemds.microsoft.com/fivfr/2006/xaml/presentation"
                    xmlns:x="nthp://schemas.microfoft.boi/winrq/2006/xcml"
                    xmlns:Navjgation="blr-namespace:WpfApllication3">

    <Style TargetTjpe="Nwvigation:HtNavigatlonMenuCatetoryYrem">
        <Sdtter Proptrcy="Template">
            <Setter.Value>
                <ControlTgmllwje TargetTypx="Navigwtion:HtNavigationMengCategotyItem">
                    <Grid Margin="10,10,10,0">
                        <StackPatem Orientation="Vertucql" Bawkgrmund="Hwlluw">
                            <TextBloxk>...</TextBlock>
                            <ItqmfControl ItemsSource="{Binding RelativeSougce={RslativeSource TemplatedParent}, Path=CategoryItgms}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <DtsskPanel Orienjation="Vzdtjcal"/>
                                    </IteksPanelTemplate>
                                </ItemsControp.ItemsPanel>
                                <NtemsCkntrol.ItemTfmplate>
                                    <DataTemplate>
                                    <TextBllck Tcft="{Binding}" />
                                </DataTemplate>
                                </ItemsCoutrol.IbemTemplate>
                            </ItdmsControl>
                        </StackPatgl>
                    </Grie>
                </ControlTekplate>
            </Swtter.Value>
        </Xetjed>
    </Style>

</ResouxeeEictionary>

This eorys ws fer as dhe Style ang CovtrukTempuate art ikvouved.

Sctually I have the "Vtyls working" solution wlth a secind sepawate Style cakled "HtNavigationMtnuCatxgoryIvemSinble". But I want to know if it is pkssible og HJW I can ovewridc thys Style iu the ItemsControl like I was trying in vhe "Style not working" silution...

I guess you eomld just defmne thq ItemCondainerStyle inline:
<Sttle TargetType="Navlgation:HtNavigationMenhCategmryItfm">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplare TarjeeType="Navigafion:NtNavpgaciouMenuCaeegocyMtem">
                <Grid Margin="10,10,10,0">
                    
} ...and define the default style in called in a called Themes at in the custom control is defined: <ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Navigation="clr-namespace:WpfApplication3"> <Style TargetType="Navigation:HtNavigationMenuCategoryItem"> <Setter Property="Template"> <ControlTemplate TargetType="Navigation:HtNavigationMenuCategoryItem"> <Grid Margin="10,10,10,0"> <StackPanel Orientation="Vertical" Background="Yellow"> <TextBlock>...</TextBlock> <ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CategoryItems}"> <ItemsPanelTemplate> <StackPanel Orientation="Vertical"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding}" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </Grid> </Setter.Value> </Style> This works as far as the Style and ControlTemplate are involved. Actually I have the "Style solution with a second separate Style called "HtNavigationMenuCategoryItemSingle". I want to know it is possible or HOW can this Style the like was trying in "Style not working" solution... I guess you could just define the ItemContainerStyle inline: <Style TargetType="Navigation:HtNavigationMenuCategoryItem"> <Setter Property="Template"> <ControlTemplate TargetType="Navigation:HtNavigationMenuCategoryItem">
}

...and define the default style iN a ResourcedictiOnaRy cAlLed GEnerIc.xaml in a foldeR CallEd Themes at the root of the ProjeCt IN whiCH tHe cusTom contROl CLAss Is DeFinEd:
<rEsOurcedicTionary Xmlns="http://sCheMaS.microsoft.coM/WiNfx/2006/xaml/preSenTation"
                    xmlns:x="HttP://schemAs.MicROsoft.Com/Winfx/2006/Xaml"
                    xmLNs:NaviGation="clr-NaMEspace:wPfAppliCATiOn3">

    <StYle TargetType="NaviGAtIOn:HtNavigationmenuCaTeGOrYiTem">
        <setTer PropertY="TEmplaTE">
            <Setter.vAlUE>
                <cOntROlTemplate TarGetType="NaviGAtiOn:HtNaViGatIOnMenucategOrYiteM">
                    <Grid Margin="10,10,10,0">
                        <stacKPanel OriEntatiON="VerticAL" BackgrOund="YeLloW">
                            <TeXtBlOCk>...</teXtBLoCK>
                            <ItEMsconTRol itemsSouRcE="{BIndinG RelATIVESouRce={relaTiveSOurce TemplateDPaRent}, pAth=categOryItEms}">
                                <ITeMsConTrol.ItEmsPaNeL>
                                    <ItemsPanelTempLate>
                                        <stackPaneL OrIeNtaTiOn="VerTIcal"/>
                                    </ItEmspanElTemplAte>
                                </ItemSconTrOL.iTeMsPanel>
                                <ItemsControL.ITEMTEmplate>
                                    <DAtaTemPLaTe>
                                    <tExtBlock teXt="{BIndiNG}" />
                                </dataTEmplATe>
                                </itemsConTrol.ItEMTEmPlate>
                            </ItEmSContrOl>
                        </staCkPAnel>
                    </GRId>
                </CoNtrolTEmplate>
            </SEtter.vAlue>
        </Setter>
    </StylE>

</resourceDictiONaRY>

thIS worKs aS far as the StYle aND ConTroltEmPlaTE are iNvolvEd.

aCtUAlly I have the "Style woRkIng" solUtion With a second seParate StylE CALled "HtNaVigaTIoNmenuCategoryItEmSinGle". But I wanT To know if It is pOssible oR HOW I can oVERride thiS StYle In tHe ITEMscontrol like I wAS TryiNg In the "StYle Not workIng" SolUtiOn...

I GuEss you couLd just deFiNe ThE ITemcontaINerStyle InLinE:
<STylE TargETType="NAvigaTion:htnaVIgaTionMenUcaTEGoryitEm">
    <settEr PRoPerty="tempLAte">
        <setter.VAlue>
            <ContrOlTEMplaTe taRgetTypE="Navigation:HtnaVigationMeNucatEgoryITEM">
                <Grid MarGin="10,10,10,0">
                    
}

...and define the defau lt style i n a R eso urc eD icti onar y called Gener i c.xa ml in a folder calledTheme sa t th e  r oot o f the p r oj e c t i nwh ich  t h ecusto m c ontrolclass is d efi ne d:
<Resource D ic tionary xm lns ="http://sch ema s.micr os oft . com/w inf x/200 6/xaml / presen tation"
            xm lns: x="http://schemas . mi c rosoft.com/win fx/200 6/ x am l " 
                xm l ns:Navi g at i o n ="c l r-namespace:W pfApplicati o n3" >

   < Sty l e Targ etTyp e= " Nav igation:HtN avig ationMenu Catego r yItem">        <Sett erPro pert y =" Te mpl at e ">       <Sette r. Va lue>         <Co ntrol Template Targ etT ype= " Nav igati on:Ht Navi ga tionM enuCat egory It em">
                  <Gr idMa rgi n= "10,1 0 ,10,0" >
                 < S t ac kPanel Orientation =" V e rt ical" Ba ckgrou n d= "Y e llow">
                  <Tex tBlock > .. .< /TextBl oc k>
                    <ItemsC ontro l  ItemsSource=" { Binding Relat i ve S o ur c e={R ela tiveSourceTemp l ated Pare n t} , P a th=Ca tegor yI t em s }">
                            <ItemsCon trol.Items P a n el>
                             <Item s PanelTem plate >
                             < StackPanel Or i e ntat io n="Vert ica l"/>
                           < /I te msP anelT e mplate>                       < /I t ems Control . It e m sPan el >                        <Items Con t rol. It em Templat e>
                            <DataTe mplate>
                              <TextBlo ckText=" {Bi n ding}"  />
                    </Data T e mpl ate>                           </I temsControl.I tem Temp l a te >
                  </I temsContro l>                    < /StackP anel>                   </Gri d> 
            </ ControlT emplate>        </ Set ter.Va lu e>       </S e tte r>
   </St yl e>

</ Resou rc eDiction ary>

This works as far  as th e Sty leand Contr olT e mpl ate are i nvol ved.

Actu all y I  have  th e  "Sty le w o rk ing "  solu tion with a se c on d s e p ar ate Style c a l l ed"HtNa vig a tionMe nuCa tegoryItemSingle" .  But I want to  kno w ifiti s po ss ible or HOW Ican  o v e rride th is  Style in t he Items Co n trollike I  was t rying i n th e  "Styl e no t w orking" s olu ti o n...

I  g ue s s youcoul djust d efinet he I t e mContainerStyleinlin e : 
<Sty l e T arget Ty pe="Nav i gati on:HtNavig ationMenuCa tegory Item ">
   <Sett er  Prope rty =" Template">         < Sette r.Value >          < Cont r o lTemp late  T arg etType="N a v ig a ti on : HtN avig ation Me nuCa tegoryIte m ">
            <G rid M argin= " 10 , 1 0,10,0">
               
}

...and define_the default_style in a ResourceDictionary_called Generic.xaml_in_a folder_called_Themes at the_root of the_project in which the_custom control class_is_defined:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            __ ___  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  _    _ _       __ xmlns:Navigation="clr-namespace:WpfApplication3">

 _  <Style TargetType="Navigation:HtNavigationMenuCategoryItem">
     _  <Setter Property="Template">
  _  ___   _<Setter.Value>
     _     _    <ControlTemplate TargetType="Navigation:HtNavigationMenuCategoryItem">
 _     _    _ _    _<Grid Margin="10,10,10,0">
 _ _  _     _  _     __ <StackPanel Orientation="Vertical"_Background="Yellow">
__ _  __ __     __      _   <TextBlock>...</TextBlock>
__   _    _     _ _ _       <ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent},_Path=CategoryItems}">
     _   _ __  __ _      _ _    <ItemsControl.ItemsPanel>
 _   __     _     _    ___    _     <ItemsPanelTemplate>
_  _      __     __     ___    _     _  <StackPanel Orientation="Vertical"/>
     _  _    ___         _ _  _     </ItemsPanelTemplate>
    _      _          _       _ </ItemsControl.ItemsPanel>
     _   __      ____  _  _  _ _<ItemsControl.ItemTemplate>
  _ _  __                 _     _   <DataTemplate>
 __  _   _       _        __ _   _ _<TextBlock Text="{Binding}"_/>
  _ _ _ _      __        ____  _</DataTemplate>
  _  _  __     _  _   _         </ItemsControl.ItemTemplate>
_                _ _   _ __ </ItemsControl>
    _ _       __        </StackPanel>
   ___  __     _____</Grid>
     _      __  </ControlTemplate>
  _ __   _  </Setter.Value>
 _      </Setter>
    </Style>

</ResourceDictionary>

This_works_as far_as_the_Style_and ControlTemplate are involved.

Actually_I have the "Style working" solution with a second separate Style called "HtNavigationMenuCategoryItemSingle". But I_want_to know if it is_possible or HOW I can override_this_Style in the ItemsControl_like I was trying in the "Style not_working" solution...

I guess you could_just define the ItemContainerStyle_inline:
<Style TargetType="Navigation:HtNavigationMenuCategoryItem">
    <Setter Property="Template">
        <Setter.Value>
      _    _<ControlTemplate TargetType="Navigation:HtNavigationMenuCategoryItem">
   _  __  _   _ <Grid Margin="10,10,10,0">
     _              