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.
104 lines
8.1 KiB
104 lines
8.1 KiB
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
x:Class="ControlCatalog.Pages.TextBoxPage"
|
|
xmlns:sys="using:System">
|
|
<StackPanel Orientation="Vertical" Spacing="4">
|
|
<Label Classes="h2">A control into which the user can input text</Label>
|
|
|
|
<WrapPanel Margin="-8,0"
|
|
HorizontalAlignment="Center">
|
|
<StackPanel Orientation="Vertical" Spacing="8" Margin="8">
|
|
<TextBox Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit." Width="200"
|
|
FontFamily="Comic Sans MS"
|
|
Foreground="Blue">
|
|
<TextBox.ContextFlyout>
|
|
<Flyout>
|
|
<TextBlock>Custom context flyout</TextBlock>
|
|
</Flyout>
|
|
</TextBox.ContextFlyout>
|
|
</TextBox>
|
|
<TextBox Width="200" PlaceholderText="ReadOnly" IsReadOnly="True" Text="This is read only"/>
|
|
<TextBox Width="200" PlaceholderText="Numeric with placeholder" TextInputOptions.ContentType="Number" />
|
|
<TextBox Width="200"
|
|
PlaceholderText="Floating Placeholder"
|
|
UseFloatingPlaceholder="True"
|
|
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."/>
|
|
<TextBox Width="200"
|
|
PlaceholderText="Custom Placeholder Color"
|
|
PlaceholderForeground="Red"/>
|
|
<TextBox Width="200"
|
|
PlaceholderText="Floating Placeholder Color"
|
|
UseFloatingPlaceholder="True"
|
|
PlaceholderForeground="Purple"/>
|
|
<MaskedTextBox Width="200" ResetOnSpace="False" Mask="(LLL) 999-0000"/>
|
|
|
|
<TextBox Width="200" Text="Validation Error">
|
|
<DataValidationErrors.Error>
|
|
<sys:Exception />
|
|
</DataValidationErrors.Error>
|
|
</TextBox>
|
|
|
|
<TextBox Width="200"
|
|
PlaceholderText="Password Box"
|
|
Classes="revealPasswordButton"
|
|
TextInputOptions.ContentType="Password"
|
|
UseFloatingPlaceholder="True"
|
|
PasswordChar="*"
|
|
Text="Password" />
|
|
<TextBox Width="200" PlaceholderText="Suggestions are hidden" TextInputOptions.ShowSuggestions="False" />
|
|
<TextBox Width="200" Text="Left aligned text" TextAlignment="Left" AcceptsTab="True" />
|
|
<TextBox Width="200" Text="Center aligned text" TextAlignment="Center" />
|
|
<TextBox Width="200" Text="Right aligned text" TextAlignment="Right" />
|
|
<TextBox Width="200" Text="Custom selection brush"
|
|
SelectionStart="5" SelectionEnd="22"
|
|
SelectionBrush="Green" SelectionForegroundBrush="Yellow" ClearSelectionOnLostFocus="False"/>
|
|
<TextBox Width="200" Text="Custom caret brush" CaretBrush="DarkOrange"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Vertical" Spacing="8" Margin="8">
|
|
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Width="200" Height="125"
|
|
Text="Multiline TextBox 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." />
|
|
<TextBox AcceptsReturn="True" Width="200" Height="125"
|
|
Text="Multiline TextBox with no 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." />
|
|
|
|
<TextBox Classes="clearButton" Text="Clear Content" Width="200" FontWeight="Normal" FontStyle="Normal" PlaceholderText="Placeholder" FontFamily="avares://ControlCatalog/Assets/Fonts#Source Sans Pro"/>
|
|
<TextBox Text="IME small font" Width="200"
|
|
FontFamily="Comic Sans MS"
|
|
FontSize="10"
|
|
Foreground="Red"/>
|
|
<TextBox Text="IME large font" Width="200"
|
|
FontFamily="Comic Sans MS"
|
|
FontSize="22"
|
|
Foreground="Red"/>
|
|
<TextBox Text="IME disabled" Width="200"
|
|
FontFamily="Comic Sans MS"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
Foreground="Red"/>
|
|
<TextBox AcceptsReturn="True"
|
|
TextWrapping="Wrap"
|
|
Width="200"
|
|
Height="125"
|
|
LineHeight="32"
|
|
Text="Multiline TextBox with TextWrapping and increased LineHeight.

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." />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Vertical" Spacing="8" Margin="8">
|
|
<Label Classes="h2" Target="{Binding #firstResMFont}">res_m fonts</Label>
|
|
<TextBox Width="200" x:Name="firstResMFont" Text="Custom font regular" FontWeight="Normal" FontStyle="Normal" FontFamily="resm:ControlCatalog.Assets.Fonts?assembly=ControlCatalog#Source Sans Pro"/>
|
|
<TextBox Width="200" Text="Custom font bold" FontWeight="Bold" FontStyle="Normal" FontFamily="resm:ControlCatalog.Assets.Fonts?assembly=ControlCatalog#Source Sans Pro"/>
|
|
<TextBox Width="200" Text="Custom font italic" FontWeight="Normal" FontStyle="Italic" FontFamily="resm:ControlCatalog.Assets.Fonts.SourceSansPro-Italic.ttf?assembly=ControlCatalog#Source Sans Pro"/>
|
|
<TextBox Width="200" Text="Custom font italic bold" FontWeight="Bold" FontStyle="Italic" FontFamily="resm:ControlCatalog.Assets.Fonts.SourceSansPro-*.ttf?assembly=ControlCatalog#Source Sans Pro"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Vertical" Spacing="8" Margin="8">
|
|
<Label Classes="h2" Target="{Binding #firstResFont}">_res fonts</Label>
|
|
<TextBox Width="200" x:Name="firstResFont" Text="Custom font regular" FontWeight="Normal" FontStyle="Normal" FontFamily="avares://ControlCatalog/Assets/Fonts#Source Sans Pro"/>
|
|
<TextBox Width="200" Text="Custom font bold" FontWeight="Bold" FontStyle="Normal" FontFamily="avares://ControlCatalog/Assets/Fonts#Source Sans Pro"/>
|
|
<TextBox Width="200" Text="Custom font italic" FontWeight="Normal" FontStyle="Italic" FontFamily="/Assets/Fonts/SourceSansPro-Italic.ttf#Source Sans Pro"/>
|
|
<TextBox Width="200" Text="Custom font italic bold" FontWeight="Bold" FontStyle="Italic" FontFamily="/Assets/Fonts/SourceSansPro-*.ttf#Source Sans Pro"/>
|
|
</StackPanel>
|
|
</WrapPanel>
|
|
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Height="200" MaxWidth="400"
|
|
FontFamily="avares://ControlCatalog/Assets/Fonts#WenQuanYi Micro Hei"
|
|
Text="计算机科学(是系统性研究信息与计算的理论基础以及它们在计算机系统中如何实现与应用的实用技术的学科。它通常被形容为对那些创造、描述以及转换信息的算法处理的系统研究。计算机科学包含很多分支领域;有些强调特定结果的计算,比如计算机图形学;而有些是探討计算问题的性质,比如计算复杂性理论;还有一些领域專注于怎样实现计算,比如程式語言理論是研究描述计算的方法,而程式设计是应用特定的程式語言解决特定的计算问题,人机交互则是專注于怎样使计算机和计算变得有用、好用,以及随时随地为人所用。

有时公众会误以为计算机科学就是解决计算机问题的事业(比如信息技术),或者只是与使用计算机的经验有关,如玩游戏、上网或者文字处理。其实计算机科学所关注的,不仅仅是去理解实现类似游戏、浏览器这些软件的程序的性质,更要通过现有的知识创造新的程序或者改进已有的程序。" />
|
|
</StackPanel>
|
|
</UserControl>
|
|
|