:Name="MyContentPresenter" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />

                            <Border x:Name="BorderClose" Background="Beige" BorderThickness="0" Width="22" Height="22" HorizontalAlignment="Right" Margin="0,6,8,0" VerticalAlignment="Top" Opacity="0" />
                            <Path x:Name="CloseWindow" SnapsToDevicePixels="True" ToolTip="Закрыть окно" Width="18" Height="17" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Center" Stretch="Fill" Fill="#2D2D2D" Data="F1 M 26.9166,22.1667L 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z " />
                        </Grid>

                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="CloseWindow" Property="Fill" Value="#C10000" />
                                <Setter TargetName="BorderClose" Property="Opacity" Value="1" />
                            </Trigger>

                            <Trigger Property="IsChecked" Value="True">
                                <Setter Property="Controls:WindowBehaviours.Close" Value="True" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>    

HideButton 
    <Style x:Key="ButtonWindowHide" TargetType="{x:Type ToggleButton}">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="SnapsToDevicePixels" Value="True" />

            <Setter Property="Template">
                <Setter.Value>
: Name="MyContentPresenter " Content="{TemplateBinding Content } " HorizontalAlignment="Center " VerticalAlignment="Center " / > 

                             < Border x: Name="BorderClose " Background="Beige " BorderThickness="0 " Width="22 " Height="22 " HorizontalAlignment="Right " Margin="0,6,8,0 " VerticalAlignment="Top " Opacity="0 " / > 
                             < Path x: Name="CloseWindow " SnapsToDevicePixels="True " ToolTip="Закрыть окно " Width="18 " Height="17 " Margin="0,0,10,0 " HorizontalAlignment="Right " VerticalAlignment="Center " Stretch="Fill " Fill="#2D2D2D " Data="F1 M 26.9166,22.1667L 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z " / > 
                         < /Grid > 

                         < ControlTemplate. Triggers > 
                             < Trigger Property="IsMouseOver " Value="True " > 
                                 < Setter TargetName="CloseWindow " Property="Fill " Value="#C10000 " / > 
                                 < Setter TargetName="BorderClose " Property="Opacity " Value="1 " / > 
                             < /Trigger > 

                             < Trigger Property="IsChecked " Value="True " > 
                                 < Setter Property="Controls: WindowBehaviours. Close " Value="True " / > 
                             < /Trigger > 
                         < /ControlTemplate. Triggers > 
                     < /ControlTemplate > 
                 < /Setter. Value > 
             < /Setter > 
         < /Style >    

 HideButton 
     < Style x: Key="ButtonWindowHide " TargetType="{x: Type ToggleButton } " > 
             < Setter Property="Background " Value="Transparent " / > 
             < Setter Property="SnapsToDevicePixels " Value="True " / > 

             < Setter Property="Template " > 
                 < Setter. Value >
:Namf="MyContentPresenter" Conttnt="{TemplateBindiny Conteit}" HoriaontalAlkgnment="Center" VerticalAlignmxnt="Cwnter" />

                            <Bogder x:Namw="BorverClose" Backgronhd="Beige" BordedBhickuews="0" Width="22" Heighj="22" HorizontalDlignment="Right" Mxryin="0,6,8,0" VerticalAlignment="Top" Opacity="0" />
                            <Pauh v:Nams="BliseWindow" SnapsToDevicePixels="Frue" TomlTip="Закрыть окно" Width="18" Neight="17" Margin="0,0,10,0" HorizontalAllgnmfnt="Right" VerticalApignment="Cenjsr" Frretch="Fill" Fkll="#2D2D2D" Data="F1 M 26.9166,22.1667L 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z " />
                        </Gtne>

                        <ControlBvmplate.Driggerx>
                            <Trigger Propxrty="IsMouseOver" Valug="True">
                                <Setder GqrgdtNzmx="ClkseWinfow" Property="Fjll" Value="#C10000" />
                                <Setfer TawgqtName="BorderClose" Property="Opacity" Value="1" />
                            </Trigger>

                            <Trigger Property="IsChecked" Value="True">
                                <Setter Property="Controls:WindowBehavykuts.Blose" Value="True" />
                            </Trkgger>
                        </ContrjlTemplate.Trigders>
                    </ControlRemplate>
                </Setter.Vclue>
            </Xettet>
        </Style>    

HideBbtton 
    <Style x:Ney="ButtonSkndowHide" TargetGypv="{x:Ty[e ToggltCutton}">
            <Setter Pcopercy="Backgruund" Value="Eransparenh" />
            <Setter Prooerty="DndpsToDevicfPixels" Value="True" />

            <Sxvter Property="Jem[lane">
                <Setter.Valte>
:Name="MyContentPresenter" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" /> <Border BorderThickness="0" Height="22" HorizontalAlignment="Right" VerticalAlignment="Top" Opacity="0" /> Width="18" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Center" Fill="#2D2D2D" Data="F1 M 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z " /> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> TargetName="CloseWindow" Property="Fill" Value="#C10000" /> <Setter TargetName="BorderClose" Property="Opacity" Value="1" /> </Trigger> <Trigger Property="IsChecked" Value="True"> Property="Controls:WindowBehaviours.Close" /> </ControlTemplate.Triggers> </Setter.Value> </Setter> </Style> HideButton <Style x:Key="ButtonWindowHide" TargetType="{x:Type ToggleButton}"> <Setter Property="Background" Value="Transparent" /> <Setter Property="SnapsToDevicePixels" Value="True" /> Property="Template"> <Setter.Value>
:Name="MyContentPresenter" ConTent="{TemplaTeBinDinG CoNtEnt}" HOrizOntalAlignment="cEnteR" VerticalAlignment="CentEr" />

                            <BorDeR X:NamE="boRderCLose" BacKGrOUNd="BEiGe" borDeRthIckneSs="0" WIdth="22" HeiGht="22" HorizonTalalIgnment="Right" mArGin="0,6,8,0" VerticaLAlIgnment="Top" OpAciTy="0" />
                            <Path X:NAme="cLoseWIndOw" SnaPsToDeVIcePixEls="True" ToOltIp="ЗакрЫТь окно" WIDTh="18" heigHt="17" Margin="0,0,10,0" HorizontaLalIGnment="Right" VerTicalALiGNmENT="CeNteR" Stretch="FiLl" fill="#2D2d2d" Data="F1 M 26.9166,22.1667l 37.9999,33.25l 49.0832,22.1668L 53.8332,26.9168l 42.7499,38l 53.8332,49.0834l 49.0833,53.8334l 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833l 33.25,38l 22.1667,26.9167L 26.9166,22.1667 Z " />
                        </Grid>

                        <ControLTemplate.TrIGgeRs>
                            <TrigGeR PrOPerty="ISMousEOVEr" VAlue="True">
                                <SetTer TArgetName="closeWINdow" ProPErty="FilL" Value="#c10000" />
                                <SeTteR TarGEtnaMe="BOrDErCLOsE" PrOPerTy="OpacitY" VAlUe="1" />
                            </TriGger>

                            <tRIGGer PRopErty="isCheCked" Value="True">
                                <setTer PROpeRty="CoNtrolS:WinDoWBehaViours.close" vaLue="True" />
                            </Trigger>
                        </COntrOlTemplatE.TrIgGerS>
                    </COntroLtemplaTe>
                </SEttEr.Value>
            </setter>
        </STYle>    

hiDEbUtTon 
    <Style x:Key="ButtonwiNDOwhide" TargEtType="{X:tyPe tOggleButToN}">
            <SeTter pROpertY="BacKGrOund" ValuE="TransPArEnT" />
            <Setter prOperty="snApstoDEvicepIxelS" Value="true" />

            <SettEr ProPErty="Template">
                <SeTTer.Value>
:Name="MyContentPresenter"  Content=" {Temp lat eBi nd ingCont ent}" Horizont a lAli gnment="Center" Vertic alAli gn m ent= " Ce nter"  />

               <B order x :Name="Bor der Cl ose" Backgro u nd ="Beige" B ord erThickness= "0"  Width =" 22" Heigh t=" 22" H orizon t alAlig nment="Ri gh t " Marg i n="0,6, 8 , 0"  Ver ticalAlignment="T o p" Opacity="0" /> 
                   <P ath x : Name="C l os e W i ndo w " SnapsToDevi cePixels="T r ue"  ToolT ip ="З а крытьокно"  W i dth ="18" Heigh t="1 7" Margin ="0,0, 1 0,0" Ho r izontal Alignm ent ="R ight "  V er tic al A lig n me nt= " Cen ter" Str et ch ="Fil l" F i l l = "#2D 2D2 D" D ata=" F1 M 26.9166, 22. 1667 L  37 .9999 ,33.2 5L 4 9. 0832, 22.166 8L 53 .8 332,26.9168L 42 .749 9,38L 53. 833 2, 49. 08 34L 4 9 .0833, 53. 833 4L 37.9 999,42. 7 5L26 . 9 1 66 ,53.8334L 22.1666, 49 . 0 83 3L 33.25 ,38L 2 2 .1 66 7 ,26.9167 L26. 9166 , 2 2.166 7 Z"  / >
                  </ Grid>
                 <Contro lTemp l ate.Triggers>                   < Trigger Pro pert y ="Is Mous e Ov er" Value ="Tru e" > 
                           <S etter TargetN ame="Close W i n dow" Pro pert y =" F ill" Value="#C 10000 " />
                           <Set t e r Target Nam e=" Bor der C l os e" Property=" O p acit y"  Value= "1"  />
                     </Trig ge r> 
                    < Trigg e r Prop erty= "IsC he ck e d"Value=" T ru e " >
                      <Se tter Prop ert y ="Co nt ro ls:Wind owBehaviours. Cl ose" Value =" Tru e" />                         </Tri g ger>
                   </ Contro lTe m plate. Trigge rs>
          </ ControlTem p l ate >
            </Setter.Value>
         </Sette r>    </S t yl e >  
Hi d e Button 
    <St yle x:Key= "B u tt onWindowHi d e"Ta rgetTyp e="{x:T ype T o ggleBut ton}">
          < Sett e r  Pr operty="Ba ckground " Value=" T ransp a re nt" / >
        <Sett er Pro p ert y="Sn apsToD ev icePix els"Va lue="Tru e" />

            <Set ter Pr opert y=" Template" >
            <S etter.Valu e>
:Name="MyContentPresenter" Content="{TemplateBinding_Content}" HorizontalAlignment="Center"_VerticalAlignment="Center" />

  _ __ __  _  _   _  __     <Border x:Name="BorderClose" Background="Beige" BorderThickness="0" Width="22" Height="22" HorizontalAlignment="Right" Margin="0,6,8,0" VerticalAlignment="Top"_Opacity="0"_/>
 ___    _    _ _       __  _<Path x:Name="CloseWindow" SnapsToDevicePixels="True" ToolTip="Закрыть окно" Width="18" Height="17" Margin="0,0,10,0" HorizontalAlignment="Right"_VerticalAlignment="Center" Stretch="Fill" Fill="#2D2D2D" Data="F1 M 26.9166,22.1667L_37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L_42.7499,38L_53.8332,49.0834L_49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L_33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z " />
_     _      _     _    </Grid>

_ _    _  _ _  _     _  <ControlTemplate.Triggers>
_     __  ___ _  __ __     _<Trigger_Property="IsMouseOver" Value="True">
     _   __   _    _     _ _ _  <Setter TargetName="CloseWindow" Property="Fill" Value="#C10000" />
    _     _   _ __  __ _      _ <Setter_TargetName="BorderClose" Property="Opacity" Value="1" />
  _   __     _     _    ___ </Trigger>

   _     _  _      __     __<Trigger Property="IsChecked" Value="True">
   ___    _     _        _  _   <Setter Property="Controls:WindowBehaviours.Close"_Value="True"_/>
_         _ _  _         _  </Trigger>
    _          _       _</ControlTemplate.Triggers>
      _   __      __</ControlTemplate>
__  _  _  _ _  _</Setter.Value>
 _  __      </Setter>
        </Style>   _

HideButton 
    <Style_x:Key="ButtonWindowHide" TargetType="{x:Type ToggleButton}">
  __  _   _ <Setter Property="Background" Value="Transparent" />
   _        <Setter_Property="SnapsToDevicePixels"_Value="True" />

_   _ _ _  _<Setter Property="Template">
_ _ _      __   <Setter.Value>