Click here to Skip to main content
15,894,241 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey out there, my next WPF question :P

I have a "basic style" in my app.xaml, and the following style makes trouble:

XML
<Style x:Key="BasicStyle">
  <Setter Property="FrameworkElement.VerticalAlignment" Value="Center"></Setter>
  <Setter Property="FrameworkElement.Margin" Value="3,1,3,1"></Setter>
</Style>

<Style TargetType="Image" BasedOn="{StaticResource BasicStyle}"></Style>

<Style TargetType="StackPanel" BasedOn="{StaticResource BasicStyle}"></Style>

<Style TargetType="DockPanel" BasedOn="{StaticResource BasicStyle}"></Style>

etc., etc...


Now when I start my program (which has a DockPanel on the top, one on the bottom and one ScrollViewer in the middle) it is flat and has a black border on the top and bottom. I don't know if this is allowed (please remove it if not), but here is a picture of what i mean:

http://www10.pic-upload.de/24.08.12/95vtc2wui54g.png

This is my Window code:

XML
<Window x:Class="NeonMika.EightTracksPlayer.SwitchSelector"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:track="clr-namespace:NeonMika.EightTracks;assembly=NeonMika.EightTracks"
        xmlns:local="clr-namespace:NeonMika.EightTracksPlayer"
        Title="SwitchSelector" Height="670" Width="959" MinWidth="500"
        removed="{StaticResource MainBackground}">
        <DockPanel Margin="0" VerticalAlignment="Stretch">
            <local:HeaderControl DockPanel.Dock="Top">
            </local:HeaderControl>

            <local:ControlArea DockPanel.Dock="Bottom">
            </local:ControlArea>

            <ContentControl Name="ContentArea"></ContentControl>
        </DockPanel>
</Window>


I tried every VerticalAlignment="Strech" you can imagine :P
Can you help me?


---------------------------------------

UPDATE:
I found out the the style for Border is the problem. It seems my whole application has a border around it. When I set VerticalAlignment="Stretch" on the Border style, it has the normal style, but now I see for the first time that there is a small black line (Border) surrounding my window. Is it possible that my window has a "built in" border I don't know about?


Thanks in advance, Markus
Posted
Updated 23-Aug-12 19:49pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900