[RESOLVED] Dashed Borders - No Clue.
Hi guys.
I'm working on a new project and seem to be a little stuck. Frankly MS should have included the ability to draw dashed and dotted borders directly into the border control.
I have blocks of XAML like this:
Code:
<Border Grid.Column="1" Grid.Row="8" Style="{StaticResource AlkaliMetalDecay}">
<StackPanel Style="{StaticResource ElementStack}">
<TextBlock Style="{StaticResource StateSolid}">87</TextBlock>
<TextBlock>Fr</TextBlock>
</StackPanel>
</Border>
What I need is for the border element here to show a dotted border around the content. I've got no idea how this should be done, though it could probably be done by combining a template for the StackPanel and a Rectangle element - though I have no idea how.
Re: Dashed Borders - No Clue.
Quote:
Frankly MS should have included the ability to draw dashed and dotted borders directly into the border control
Why? I've never seen that in any application... so why would they include it as a built in feature? Just because it happens to be what you want, doesn't mean it deserves to be built in to WPF.
Anywho, I'll have a play around and see what I can come up with.
Re: Dashed Borders - No Clue.
Borders are borders, naturally assuming everyone wants a solid border was a huge mistake (after a few minutes searching Google I found hundreds of people saying the same thing).
Anyway. I figured out a way to cheat. I basically used a grid element to position a rectangle object with a dashed array border directly over the element in question - and that worked as I wanted :)
Re: Dashed Borders - No Clue.
Ah cool, glad you got it working and thanks for sharing the solution.
PS you can search for pretty much anything in google and find hundreds of people asking the same question :P
Re: Dashed Borders - No Clue.
Yeah, that's true but that still doesn't change the fact that it is a sensible thing to include - it is even in CSS after all.