• 20.04.2024, 02:59
  • Registrieren
  • Anmelden
  • Sie sind nicht angemeldet.

 

XAML help requested

Samstag, 28. Juli 2018, 21:18

I am trying to display some text rotated 90 degrees, but not knowing XAML, my attempts have failed so far.
I am hoping one of the clever folks on this forum can provide direction.

From Googling, I believe I need to insert code similar to this:
<TextBlock>
<TextBlock.RenderTransform>
<RotateTransform Angle="90"/>
</TextBlock.RenderTransform>
</TextBlock>

But I have not been able to get the code syntax/placement correctly.

My current code is a slightly modified preset from the aquasuite:
<UserControl
x:Name="this"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<TextBlock
Text="Workload vs. Coolant Temp"
Opacity="1.0"
Height="Auto"
Width="Auto"
Foreground="#ffffffff"
FontSize="15"
FontFamily="Segoe UI"
FontWeight="Normal"
Margin="0,0,0,0"
Padding="0,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="bottom"/>
</Grid>
</UserControl>

Dienstag, 31. Juli 2018, 10:20

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<UserControl
x:Name="this"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<TextBlock
Text="Workload vs. Coolant Temp" 
Opacity="1.0"
Height="Auto" 
Width="Auto"
Foreground="Black"
FontSize="15"
FontFamily="Segoe UI"
FontWeight="Normal" 
Margin="0,0,0,0"
HorizontalAlignment="Center" 
VerticalAlignment="Top">
<TextBlock.RenderTransform>
<RotateTransform Angle="90"/>
</TextBlock.RenderTransform>
</TextBlock>
</Grid>
</UserControl>


You can also use an online xaml editor for build an layout:
http://yuvaltz.github.io/granularpad/

Dienstag, 31. Juli 2018, 21:27

Thank you very much.

Now I just have to repair my system which cratered on my Sunday. *sigh*