Can I have a stroke around the letters in a TextBlock? - xaml

Is there any way I can add a stroke to the letters of a TextBlock, but I can't seem to figure out the properties:
<TextBlock Text="Hello World">
<TextBlock.Resources>
<Stroke ?>
I cant seem to find the right documentation, as I suspect is not the same as the WPF?

Kent Boogaart solved your conundrum in 2008. Please redirect your focus to his nice answer:
Apply stroke to a textblock in WPF
Hope it helps!

Related

How to apply a background color to TextElements of a TextBlock?

Is it possible to apply a background color to the inline text of a TextBlock instead of the entire rectangular bounds of the TextBlock? In other words, I would like to have this:
<TextBlock TextWrapping="Wrap">
<!-- No such "Background" property -->
<Span Background="Red">
The quick brown fox jumps over the lazy dog
</Span>
</TextBlock>
(Just like <span style="background-color: red"> in HTML)
Instead of this:
<Border Background="Red">
<TextBlock TextWrapping="Wrap">
The quick brown fox jumps over the lazy dog
</TextBlock>
</Border>
Is this even supported? I've been looking through the documentation for the TextBlock and RichTextBlock classes but I can't see any way of setting the background of the inline text. I think WPF supports this.
EDIT
I should mention, I need this to work with automatically wrapped text. I don't know how many lines there will be, or else I could just manually use a Border for each line of text.
It seems that this is not currently supported in UWP apps.
WPF has a Background property for Run elements, which can be used inside TextBlock, but UWP's Run does not support this.
The only way I can think of to implement this would be using HTML and a WebView, or somehow using Win2D rendering, both of which are quite cumbersome solutions...

How to disable new 'fluid/scaling layout' in WP8.1 apps?

I'm trying to port my WP8 app to WP8.1 by creating a new Universal app.
One thing that really drives me crazy is the new scaling behaviours of WP on higher resolution screens.
I just want my XAML to scale up (so everything becomes bigger). Just like it did on WP8. I've tried to do this with a Viewbox but that didn't work out very well either (weird margins all over the place :S).
How do I achieve this?
Kind regards,
Niels
I'm also making use of Viewboxes and had problems with weird margins but setting the Stretch property of the Viewbox to Fill solved it:
<Viewbox Stretch="Fill">
<Grid Height="1280" Width="768">
<Grid> ... </Grid>
</Grid>
</Viewbox>
Hope this helps!

C4F RoundButton content appears on image

Tried adding a Coding4Fun RoundButton to my WP8 XAML. Looked around and copied from samples (i.e. this site), but despite the nice images I see everywhere, the text is displayed on top of my icon:
The XAML code is:
<c4f:RoundButton x:Name="buttonShrtn" Click="buttonShrtn_Click" ImageSource="Assets/Images/icon-button-32.png" FontSize="18" Content="Shrtn" VerticalAlignment="Center" HorizontalAlignment="Right"/>
I just can't find a similar case anywhere. Could there be something else in my XAML that can cause this?
You have to use Label instead of Content.
EDIT
RoundToggleButton, RoundButton, OpacityToggleButton, Tile, and ImageTile content property shifted to Label property. (geekchamp)
Toolkit description.

How do you apply shadows to controls in xaml for Windows 8(RT)

I see that most of the WPF stuff use for example DropShadowEffect, but my xaml in WinRT doesn't recognize that, is there something else to use?
However it's easy to add dropshadow to text. As photoshop dude I immediately released this:
<Grid>
<TextBlock Margin="1,1,0,0" Foreground="<!--Shadow Color-->" Text="Some text"/>
<TextBlock Foreground="<!--Text Color-->" Text="Some text"/>
</Grid>
You are correct, the DropShadowEffect is not available in Windows Store apps.
For now, effects are programmed with DirectX and C++. If you don't want to write your own interop library in C++, check out the sharpdx.org/ library
If you know the Shape of the Control you could create an Image (.png e.g.) with a dropshadow effect towards the outer bounds and include it in the style of the control with the help of Nine-Grid ( http://msdn.microsoft.com/en-us/library/windows/desktop/bb189722.aspx )
(if the dropshadow is 5px wide you can set the margin to -5 and the nine-grid values to 5 to make the shadow appear around the control)
Greetings
You can use DropShadowBitmapEffect to create Shadow effect.
The documentation and an example can be found here.

how to create a rect button in xaml

hai guys
i need your help to create a rectangle button with xaml.
if we create a default button will rounded rectangle button.
and i not found corner radius setting..
please help me..
You have to create your own Style for your button.
Take a loot at this example, and then you can play with RadiusX RadiusY properties of both Rectangles to avoid rounded rectangle.
Your basic style would be:
<Rectangle>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Rectangle>
That would be a very basic button style that has rect corners. I still suggest to read blurg's link for more info, as this can be very flexible and/or complex ;)
Cheers.
Take a look at the MSDN example for creating fancy buttons here. Also take a look at the answer to this question.