c# - Menu item background Not changing When IsSubMenu Property is triggered -


i trying change background color of selcted menu item submenu opened.if change width or foreground color when issubmenuopen property true it's working, background color don't change. can tell me reason?

here code:

 <usercontrol x:class="robohealthapplication.usercontrols.leftmenu"                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"                   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"                   mc:ignorable="d"                   d:designheight="300" d:designwidth="320"                    >         <usercontrol.resources>             <style targettype="menuitem">                 <setter property="background" value="#e4adb0"/>                 <setter property="minwidth" value="230px"/>                 <setter property="minheight" value="50px"/>                 <setter property="fontsize" value="20px"/>                 <style.triggers>                     <trigger property="ismouseover" value="true">                         <setter property="background" value="#f0e0e0" />                     </trigger>                     <trigger property="ispressed" value="true">                         <setter property="background" value="#f0e0e0" />                     </trigger>                     <trigger property="issubmenuopen" value="true">                         <setter property="background" value="orange" />                          <setter property="minwidth" value="500px" />                         <setter property="foreground" value="orange" />                     </trigger>                 </style.triggers>             </style>         </usercontrol.resources>         <dockpanel lastchildfill="false" margin="0 20 0 20">             <dockpanel lastchildfill="false" minwidth="70px" minheight="300px" background="#9a1f24">              </dockpanel>             <dockpanel lastchildfill="false" minwidth="240px" minheight="300px" background="#c2272d">                 <menu minwidth="240px"              minheight="300px"              foreground="#9a1f24"             verticalalignment="top"             horizontalalignment="left"             background="#c2272d"            >                      <menu.itemspanel>                         <itemspaneltemplate>                             <virtualizingstackpanel orientation="vertical" />                         </itemspaneltemplate>                     </menu.itemspanel>                      <menuitem header="bar code">                     </menuitem>                      <menuitem header="appointments">                     </menuitem>                     <menuitem header="pharmacy">                     </menuitem>                     <menuitem header="staff">                         <menuitem header="option1"/>                         <menuitem header="option2"/>                         <separator/>                         <menuitem header="option3"/>                         <menuitem header="option4"/>                     </menuitem>                     <menuitem header="doctor">                         <menuitem header="option1"/>                         <menuitem header="option2"/>                         <separator/>                         <menuitem header="option3"/>                         <menuitem header="option4"/>                     </menuitem>                     <menuitem header="patients">                         <menuitem header="option1"/>                         <menuitem header="option2"/>                         <separator/>                         <menuitem header="option3"/>                         <menuitem header="option4"/>                     </menuitem>                 </menu>             </dockpanel>         </dockpanel>     </usercontrol> 

you need override menu control template achieving this.you can refer menucontroltemplate


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -