csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
7.0 KiB
145 lines
7.0 KiB
<UserControl x:Class="ControlCatalog.Pages.TextBlockPage"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
<!--<UserControl.Styles>
|
|
<Style Selector="TextBlock">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
</Style>
|
|
</UserControl.Styles>-->
|
|
<StackPanel>
|
|
<TextBlock Classes="h2">A control that can display text</TextBlock>
|
|
<WrapPanel MaxWidth="680"
|
|
Margin="-10,0"
|
|
HorizontalAlignment="Center">
|
|
<WrapPanel.Styles>
|
|
<Style Selector="Border">
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlHighlightBaseMediumLowBrush}" />
|
|
<Setter Property="Padding" Value="2" />
|
|
<Setter Property="Margin" Value="10" />
|
|
<Setter Property="Width" Value="200" />
|
|
</Style>
|
|
</WrapPanel.Styles>
|
|
<Border>
|
|
<StackPanel Spacing="8">
|
|
<TextBlock Margin="0,0,10,0"
|
|
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
TextTrimming="CharacterEllipsis" />
|
|
<TextBlock Margin="0,0,10,0"
|
|
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
TextTrimming="WordEllipsis" />
|
|
<TextBlock Text="Left aligned text" TextAlignment="Left" />
|
|
<TextBlock Text="Center aligned text" TextAlignment="Center" />
|
|
<TextBlock Text="Right aligned text" TextAlignment="Right" />
|
|
</StackPanel>
|
|
</Border>
|
|
<Border>
|
|
<StackPanel Width="300" Spacing="8">
|
|
<TextBlock Text="text update issue 4824:" />
|
|
<TextBlock x:Name="txtChanging" />
|
|
<TextPresenter x:Name="tpChanging" />
|
|
<Button x:Name="btn" Content="Update" />
|
|
<TextBlock Text="TextWrapping right/left issue- 4830:" />
|
|
<Panel HorizontalAlignment="Left">
|
|
<Border BorderBrush="Blue" BorderThickness="2">
|
|
<TextPresenter Text="0123456 0123456 0123456 0123456" Width="80"
|
|
TextWrapping="Wrap" TextAlignment="Right" Background="Yellow" HorizontalAlignment="Left"/>
|
|
</Border>
|
|
<Border Width="2" HorizontalAlignment="Center" BorderBrush="Gray" Opacity="0.3" BorderThickness="1" />
|
|
</Panel>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border>
|
|
<StackPanel Spacing="8">
|
|
<TextBlock Text="new line\r\n 
new line\r 
new line\n 
Multiline TextBlock with TextWrapping.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est." TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</Border>
|
|
<Border>
|
|
<StackPanel Spacing="8">
|
|
<TextBlock FontFamily="avares://ControlCatalog/Assets/Fonts#Source Sans Pro"
|
|
FontStyle="Normal"
|
|
FontWeight="Normal"
|
|
Text="Custom font regular" />
|
|
<TextBlock FontFamily="avares://ControlCatalog/Assets/Fonts#Source Sans Pro"
|
|
FontStyle="Normal"
|
|
FontWeight="Bold"
|
|
Text="Custom font bold" />
|
|
<TextBlock FontFamily="/Assets/Fonts/SourceSansPro-Italic.ttf#Source Sans Pro"
|
|
FontStyle="Italic"
|
|
FontWeight="Normal"
|
|
Text="Custom font italic" />
|
|
<TextBlock FontFamily="/Assets/Fonts/SourceSansPro-*.ttf#Source Sans Pro"
|
|
FontStyle="Italic"
|
|
FontWeight="Bold"
|
|
Text="Custom font italic bold" />
|
|
</StackPanel>
|
|
</Border>
|
|
<Border>
|
|
<StackPanel Spacing="8">
|
|
<TextBlock Text="new line\n\r 

new line\r\n 
new line\n 
new line\r 
last line"/>
|
|
<TextBlock Text="Underline" TextDecorations="Underline" />
|
|
<TextBlock Text="Strikethrough" TextDecorations="Strikethrough" />
|
|
<TextBlock Text="Overline" TextDecorations="Overline" />
|
|
<TextBlock Text="Baseline" TextDecorations="Baseline" />
|
|
<TextBlock Text="Custom TextDecorations">
|
|
<TextBlock.TextDecorations>
|
|
<TextDecorationCollection>
|
|
<TextDecoration Location="Overline"
|
|
StrokeThickness="2"
|
|
StrokeThicknessUnit="Pixel">
|
|
<TextDecoration.Stroke>
|
|
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
|
|
<LinearGradientBrush.GradientStops>
|
|
<GradientStop Offset="0" Color="Red" />
|
|
<GradientStop Offset="1" Color="Green" />
|
|
</LinearGradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</TextDecoration.Stroke>
|
|
</TextDecoration>
|
|
<TextDecoration Location="Strikethrough"
|
|
StrokeThickness="1"
|
|
StrokeThicknessUnit="Pixel">
|
|
<TextDecoration.Stroke>
|
|
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
|
|
<LinearGradientBrush.GradientStops>
|
|
<GradientStop Offset="0" Color="Green" />
|
|
<GradientStop Offset="1" Color="Blue" />
|
|
</LinearGradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</TextDecoration.Stroke>
|
|
</TextDecoration>
|
|
<TextDecoration Location="Underline"
|
|
StrokeThickness="2"
|
|
StrokeThicknessUnit="Pixel">
|
|
<TextDecoration.Stroke>
|
|
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
|
|
<LinearGradientBrush.GradientStops>
|
|
<GradientStop Offset="0" Color="Blue" />
|
|
<GradientStop Offset="1" Color="Red" />
|
|
</LinearGradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</TextDecoration.Stroke>
|
|
</TextDecoration>
|
|
</TextDecorationCollection>
|
|
</TextBlock.TextDecorations>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border>
|
|
<StackPanel Spacing="8">
|
|
<TextBlock Text="🏻 👌🏻" />
|
|
<TextBlock Text="🏼 👌🏼" />
|
|
<TextBlock Text="🏽 👌🏽" />
|
|
<TextBlock Text="🏾 👌🏾" />
|
|
<TextBlock Text="🏿 👌🏿" />
|
|
<TextPresenter Text="🏿 👌🏿"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border>
|
|
<StackPanel Spacing="8">
|
|
<TextBlock Text="👪 👨👩👧 👨👩👧👦" />
|
|
</StackPanel>
|
|
</Border>
|
|
</WrapPanel>
|
|
</StackPanel>
|
|
</UserControl>
|
|
|