2012-03-28 7 views

Odpowiedz

4

Może?

<DockPanel LastChildFill="True"> 
     <Rectangle Fill="Red" DockPanel.Dock="Top" Height="2"/> 
     <Rectangle Fill="Yellow" DockPanel.Dock="Left" Width="2"/> 
     <Rectangle Fill="Green" DockPanel.Dock="Right" Width="2"/> 
     <Rectangle Fill="Blue" DockPanel.Dock="Bottom" Height="2"/> 
     <Rectangle Fill="Wheat"/> 
    </DockPanel> 
4

Trochę hacky, ale działa.

<Grid> 
    <Border BorderThickness="1,0,0,0" BorderBrush="Blue"/> 
    <Border BorderThickness="0,2,0,0" BorderBrush="Red"/> 
    <Border BorderThickness="0,0,3,0" BorderBrush="Green"/> 
    <Border BorderThickness="0,0,0,4" BorderBrush="Orange"/> 
</Grid> 

Prawdopodobnie lepiej utworzyć własną Decorator.

0

Jest hacky sposób, że za pomocą czterech Border https://stackoverflow.com/a/1797045/5229294

<Border BorderThickness="0,0,0,10" BorderBrush="Green"> 
    <Border BorderThickness="0,0,10,0" BorderBrush="Blue"> 
     <Grid> 
      <Button>Hello</Button> 
     </Grid> 
    </Border> 
</Border> 
Powiązane problemy