|
-
Oct 3rd, 2010, 12:37 PM
#1
Thread Starter
Frenzied Member
[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.
-
Oct 5th, 2010, 12:52 PM
#2
Re: Dashed Borders - No Clue.
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.
-
Oct 5th, 2010, 01:03 PM
#3
Thread Starter
Frenzied Member
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
-
Oct 5th, 2010, 02:26 PM
#4
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
-
Oct 5th, 2010, 02:30 PM
#5
Thread Starter
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|