c# - Infragistics PanelToolWindow drops Ribbon Window Tab -


the situation

so have infragistics dockmanager inside of infragistics ribbon window.

inside dock manager have number of separate user controls. of have ribbon tab items specific them.

enter image description here

when content pane undocks dock manager , floats, it's tab removed ribbon.

this happens because being spawned new window. when it's added new window, it's being removed main ribbon windows' visual tree. thus, removes it's ribbon because thinks it's gone.

the proposed solution

so overcome issue have decided best course of action restyle paneltoolwindow ribbon window display children controls' ribbons.

the problem

every time attempt restyle paneltoolwindow doesn't work. i'm not sure why it's not working , there practically 0 documentation regarding restyling window (please see links below documentation did find).

the sample code

i've tried few different solutions. maybe it's how implementing style.

here basic template have used.

<controltemplate targettype="{x:type igdock:panetoolwindow}"                   x:key="documentviewertoolwindow">  <border     background="{templatebinding background}"    borderbrush="{templatebinding borderbrush}"    borderthickness="{templatebinding borderthickness}">   <grid>     <grid.rowdefinitions>        <rowdefinition height="auto" />        <rowdefinition/>     </grid.rowdefinitions>     <dockpanel grid.row="0" >         <contentpresenter content="{templatebinding title}" />     </dockpanel>         <contentpresenter content="{templatebinding content}" grid.row="1"/>    </grid>   </border> </controltemplate> 

i have attempted:

  • adding above control template user control resources above dock manager in style targets igdock:panetoolwindow. hope here restyle every panetoolwindow that's floating. didn't work

  • adding above control template app.xaml resources. didn't work.

  • i attempted restyle dock manager explicitly below code

     <style targettype="igdock:panetoolwindow">        <setter property="style"         value="{staticresource resourcekey=documentviewertoolwindow}"/>  </style> 
  • i have attempting setting useosnonclientarea = false within toolwindowloaded event , hard coding dockmanager's xaml tag. neither of worked.

  • i have tried pulling window.content out of panetoolwindoweventargs.window.content property , spawning them custom window.contentcontrol.content property. works bad behaviors duplicate windows on loading.

refrences

http://www.infragistics.com/community/forums/t/60620.aspx

http://www.infragistics.com/community/blogs/alex_fidanov/archive/2009/11/10/customizing-xamdockmanager-s-floating-panes.aspx

in order restyle panetoolwindow must 3 things.

first, create style. did mine in xaml

<window.resources>         <style targettype="{x:type igdock:panetoolwindow}" x:key="dockptw">              <setter property="template">                 <setter.value>                     <controltemplate targettype="{x:type igdock:panetoolwindow}">                          <igribbon:ribbonwindowcontenthost initialized="ribbonwindowcontenthost_initialized">                              <igribbon:ribbonwindowcontenthost.ribbon>                                 <igribbon:xamribbon x:name="main_ribbon" dockpanel.dock="top">                                  </igribbon:xamribbon>                             </igribbon:ribbonwindowcontenthost.ribbon>                             <grid width="1000" height="500">                               </grid>                         </igribbon:ribbonwindowcontenthost>                     </controltemplate>                 </setter.value>             </setter>         </style>      </window.resources> 

second, need listen xamdockmanager toolwindow_loaded event.

finally, within event set 2 properties.

first set useosnonclientarea = false panetoolwindow knows use custom chrome.

  e.window.useosnonclientarea = false; 

then set style property style declared in xaml.

  e.window.style = this.resources["dockptw"] style; 

note

this not complete solution. you still need reimplement dragging capabilities of panetoolwindow, discussing here


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -