Problem with align button in treeview in wpf

Posted by phenevo on Stack Overflow See other posts from Stack Overflow or by phenevo
Published on 2010-04-23T10:34:02Z Indexed on 2010/04/23 10:43 UTC
Read the original article Hit count: 165

Filed under:
|

Hi,

I've got something:

<HierarchicalDataTemplate DataType="{x:Type MyService:Country}"
                                  ItemsSource="{Binding Path=ListOfAreas}">
                <StackPanel Orientation="Horizontal">
                    <TextBlock TextAlignment="Center" Text="{Binding Path=Name}"/>
                    <Button Name="MyButton" Height="20" Content="Add Area"></Button>
                </StackPanel>
            </HierarchicalDataTemplate>

It works, but not nice way, because I want to have TextBox at middle hight of button. Now it is at top hight of button.

for example:

NOW:

MYTEXTBOX ||||||||||||
          ||Add Area|| 
          ||||||||||||

Expected result

          ||||||||||||
MYTEXTBOX ||Add Area|| 
          ||||||||||||

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf