Justifying of Expander’s header button

From internal discussion list:

From: MS employee
Subject: Expander arrow button placement

Hi,

I have an Expander that expands in the Down direction. How do I make the Expander button be justified to the right, rather than the left which is the default?

From: Another helpful MS employee
Subject: RE: Expander arrow button placement

There is no easy way as I know, you have to restyle the Expander to achieve it.

From: Myself
Subject: RE: Expander arrow button placement

The easiest way to achieve the right justification of Expander header is by using following “double – transformation”. Actually, you are flipping the expander and then flipping back it’s header text. You’ll have to flip it’s content as well.

This way is quick and dirty, however the best way to do it is by creating custom template for header.

<Expander RenderTransformOrigin="0.5,0.5">
       <Expander.Header>
       <TextBlock Margin="30,0,30,0" VerticalAlignment="Top" Text="Test">
       <TextBlock.RenderTransform>
       <TransformGroup>
       <ScaleTransform ScaleX="-1" ScaleY="1"/>
       </TransformGroup>
       </TextBlock.RenderTransform>
       </TextBlock>
       </Expander.Header>
       <Expander.RenderTransform>
       <TransformGroup>
       <ScaleTransform ScaleX="-1" ScaleY="1"/>
       </TransformGroup>
       </Expander.RenderTransform>
      </Expander>

   Have a nice day.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • Live
  • Reddit
  • TwitThis
  • email
  • Slashdot
  • StumbleUpon

2 Responses to “Justifying of Expander’s header button”

  1. Guy Burstein Says:

    מה דעתך לגבי כנס המפתחים הבא?

    http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/07/15/Developer-Academy-2-_2D00_-_D005D905E805D505E205_-_D405DE05E405EA05D705D905DD05_-_D405D105D005_.aspx

  2. DotNetKicks.com Says:

    You’ve been kicked (a good thing) – Trackback from DotNetKicks.com

Leave a Reply

Recommended

 


Sponsor


Partners

WPF Disciples
Dreamhost
Code Project
Switched to Better Place

Together