c# - Right width of wpf expander header -


i've found solution of problem.

width=”{binding relativesource={relativesource mode=findancestor, ancestortype=x:type expander}}, path=actualwidth}” 

but i've got not correct width. (the width of toggle button not taken consideration) there solutions in xaml this?

result

<page x:class="restore.page1"       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"        xmlns:local="clr-namespace:restore"       mc:ignorable="d"        d:designheight="300" d:designwidth="300"       title="page1">      <grid background="aliceblue" horizontalalignment="stretch">           <expander name="expander_name">             <expander.header>                 <grid background="red" width="{binding elementname=expander_name, path=actualwidth}">                     <grid.columndefinitions>                         <columndefinition width="auto"/>                         <columndefinition width="30"/>                     </grid.columndefinitions>                     <textblock text="sdfsfsd" grid.column="0" />                     <button content="ok" grid.column="1" />                 </grid>             </expander.header>         </expander>      </grid> </page> 


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -