gallery(LineEdit): split showcase scenarios into lazy tabs

This commit is contained in:
chinboy
2026-06-03 13:44:37 +08:00
parent 459275f9e0
commit bb42201dcb
13 changed files with 518 additions and 361 deletions
@@ -2049,6 +2049,10 @@ namespace AtomUIGallery.Localization
PrefixAndSuffixTitle,
PrePostTabDescription,
PrePostTabTitle,
ScenarioBasic,
ScenarioSearch,
ScenarioState,
ScenarioTextArea,
SearchBoxDescription,
SearchBoxTitle,
SearchBoxWithLoadingDescription,
@@ -6,6 +6,11 @@ namespace AtomUIGallery.ShowCases.LineEdit;
[LanguageProvider(LanguageCode.en_US, LineEditShowCase.LanguageId)]
internal class en_US : LanguageProvider
{
public const string ScenarioBasic = "Basic";
public const string ScenarioState = "State";
public const string ScenarioSearch = "Search";
public const string ScenarioTextArea = "TextArea";
public const string BasicUsageTitle = "Basic usage";
public const string BasicUsageDescription = "Basic usage example.";
public const string InputSizesTitle = "Three sizes of Input";
@@ -6,6 +6,11 @@ namespace AtomUIGallery.ShowCases.LineEdit;
[LanguageProvider(LanguageCode.zh_CN, LineEditShowCase.LanguageId)]
internal class zh_CN : LanguageProvider
{
public const string ScenarioBasic = "基础";
public const string ScenarioState = "状态";
public const string ScenarioSearch = "搜索";
public const string ScenarioTextArea = "文本域";
public const string BasicUsageTitle = "基础用法";
public const string BasicUsageDescription = "基础用法示例。";
public const string InputSizesTitle = "输入框三种尺寸";
@@ -0,0 +1,102 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="AtomUIGallery.ShowCases.LineEdit.LineEditBasicShowCase"
xmlns:vm="using:AtomUIGallery.ShowCases.LineEdit"
xmlns:atom="https://atomui.net"
xmlns:antdicons="https://atomui.net/icons/antdesign"
xmlns:gallery="https://atomui.net/oss-controls/gallery"
x:DataType="vm:LineEditViewModel">
<gallery:ShowCasePanel>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource BasicUsageTitle}"
Description="{gallery:LineEditShowCaseLangResource BasicUsageDescription}">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBasicUsage}" />
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource InputSizesTitle}"
Description="{gallery:LineEditShowCaseLangResource InputSizesDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextLarge}" SizeType="Large"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextMiddle}" SizeType="Middle"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextSmall}" SizeType="Small"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined}" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource VariantsTitle}"
Description="{gallery:LineEditShowCaseLangResource VariantsDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleNormal}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextOutlined}" StyleVariant="Outlined" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBorderless}" StyleVariant="Borderless" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextUnderlined}" StyleVariant="Underlined" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleLeftaddonAndRightaddon}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource PrePostTabTitle}"
Description="{gallery:LineEditShowCaseLangResource PrePostTabDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Width="400" HorizontalAlignment="Left"
Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
<atom:LineEdit RightAddOn="{antdicons:AntDesignIconProvider Kind=SettingOutlined}" Width="400"
HorizontalAlignment="Left"
Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
<atom:LineEdit LeftAddOn="http://" InnerRightContent=".com" Width="400" HorizontalAlignment="Left"
Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource WithClearIconTitle}"
Description="{gallery:LineEditShowCaseLangResource WithClearIconDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputWithClearIcon}" IsAllowClear="True" />
<atom:TextArea PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextTextareaWithClearIcon}" IsAllowClear="True" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource PasswordBoxTitle}"
Description="{gallery:LineEditShowCaseLangResource PasswordBoxDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputPassword}"
Width="400"
RevealPassword="False"
PasswordChar="•"
HorizontalAlignment="Left"
IsEnableRevealButton="True" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputPassword}"
Width="400"
RevealPassword="False"
HorizontalAlignment="Left"
PasswordChar="•"
IsEnableRevealButton="True"
IsAllowClear="True" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource PrefixAndSuffixTitle}"
Description="{gallery:LineEditShowCaseLangResource PrefixAndSuffixDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextEnterYourUsername}"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined, StrokeBrush=#D7D7D7}"
InnerRightContent="{antdicons:AntDesignIconProvider Kind=InfoCircleOutlined, StrokeBrush=#8C8C8C}" />
<atom:LineEdit InnerLeftContent="¥" InnerRightContent="RMB" />
<atom:LineEdit InnerLeftContent="¥" InnerRightContent="RMB" IsEnabled="False" />
</StackPanel>
</gallery:ShowCaseItem>
</gallery:ShowCasePanel>
</UserControl>
@@ -0,0 +1,11 @@
using ReactiveUI.Avalonia;
namespace AtomUIGallery.ShowCases.LineEdit;
public partial class LineEditBasicShowCase : ReactiveUserControl<LineEditViewModel>
{
public LineEditBasicShowCase()
{
InitializeComponent();
}
}
@@ -0,0 +1,126 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="AtomUIGallery.ShowCases.LineEdit.LineEditSearchShowCase"
xmlns:vm="using:AtomUIGallery.ShowCases.LineEdit"
xmlns:atom="https://atomui.net"
xmlns:antdicons="https://atomui.net/icons/antdesign"
xmlns:gallery="https://atomui.net/oss-controls/gallery"
x:DataType="vm:LineEditViewModel">
<gallery:ShowCasePanel>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource SearchBoxTitle}"
Description="{gallery:LineEditShowCaseLangResource SearchBoxDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch" SizeType="Large" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
HorizontalAlignment="Stretch"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
IsAllowClear="True" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
HorizontalAlignment="Stretch"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextText}"
InnerRightContent="{antdicons:AntDesignIconProvider Kind=AudioOutlined, StrokeBrush=#1677ff, Width=16, Height=16}"
IsAllowClear="True"
SizeType="Large" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleFilled}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
LeftAddOn="https://"
StyleVariant="Filled" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
LeftAddOn="https://"
StyleVariant="Filled" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleBorderless}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
LeftAddOn="https://"
StyleVariant="Borderless" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
LeftAddOn="https://"
StyleVariant="Borderless" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleUnderlined}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
LeftAddOn="https://"
StyleVariant="Underlined" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
LeftAddOn="https://"
StyleVariant="Underlined" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource DisabledSearchBoxTitle}"
Description="{gallery:LineEditShowCaseLangResource DisabledSearchBoxDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left" SizeType="Large"
IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
HorizontalAlignment="Left"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
IsAllowClear="True" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
HorizontalAlignment="Left"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextText}"
IsAllowClear="True"
SizeType="Large" IsEnabled="False">
<atom:SearchEdit.InnerRightContent>
<antdicons:AudioOutlined Width="16" Height="16" Name="AudioOutlined">
<antdicons:AudioOutlined.Styles>
<Style Selector="atom|Icon#AudioOutlined">
<Setter Property="Foreground" Value="{atom:SharedTokenResource ColorPrimary}"/>
</Style>
</antdicons:AudioOutlined.Styles>
</antdicons:AudioOutlined>
</atom:SearchEdit.InnerRightContent>
</atom:SearchEdit>
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource SearchBoxWithLoadingTitle}"
Description="{gallery:LineEditShowCaseLangResource SearchBoxWithLoadingDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchLoadingDefault}"
Width="400"
IsOperating="True"
HorizontalAlignment="Left" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchLoadingWithEnterbutton}" Width="400"
HorizontalAlignment="Left"
IsOperating="True"
SearchButtonStyle="Primary" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
IsOperating="True"
HorizontalAlignment="Left"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
SizeType="Large" />
</StackPanel>
</gallery:ShowCaseItem>
</gallery:ShowCasePanel>
</UserControl>
@@ -0,0 +1,11 @@
using ReactiveUI.Avalonia;
namespace AtomUIGallery.ShowCases.LineEdit;
public partial class LineEditSearchShowCase : ReactiveUserControl<LineEditViewModel>
{
public LineEditSearchShowCase()
{
InitializeComponent();
}
}
@@ -3,365 +3,14 @@
x:Class="AtomUIGallery.ShowCases.LineEdit.LineEditShowCase"
xmlns:vm="using:AtomUIGallery.ShowCases.LineEdit"
xmlns:atom="https://atomui.net"
xmlns:antdicons="https://atomui.net/icons/antdesign"
xmlns:gallery="https://atomui.net/oss-controls/gallery"
x:DataType="vm:LineEditViewModel">
<gallery:ShowCasePanel>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource BasicUsageTitle}"
Description="{gallery:LineEditShowCaseLangResource BasicUsageDescription}">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBasicUsage}" />
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource InputSizesTitle}"
Description="{gallery:LineEditShowCaseLangResource InputSizesDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextLarge}" SizeType="Large"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextMiddle}" SizeType="Middle"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextSmall}" SizeType="Small"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined}" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource VariantsTitle}"
Description="{gallery:LineEditShowCaseLangResource VariantsDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleNormal}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextOutlined}" StyleVariant="Outlined" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBorderless}" StyleVariant="Borderless" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextUnderlined}" StyleVariant="Underlined" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleLeftaddonAndRightaddon}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource DisabledTitle}"
Description="{gallery:LineEditShowCaseLangResource DisabledDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleNormal}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextOutlined}" StyleVariant="Outlined" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBorderless}" StyleVariant="Borderless" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextUnderlined}" StyleVariant="Underlined" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextOutlined}" StyleVariant="Outlined" Status="Error" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" Status="Error" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBorderless}" StyleVariant="Borderless" Status="Error" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextUnderlined}" StyleVariant="Underlined" Status="Error" IsEnabled="False" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleLeftaddonAndRightaddon}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" Status="Error" IsEnabled="False" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled" Status="Error"
IsEnabled="False" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless"
Status="Error" IsEnabled="False" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined"
Status="Error" IsEnabled="False" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource PrePostTabTitle}"
Description="{gallery:LineEditShowCaseLangResource PrePostTabDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Width="400" HorizontalAlignment="Left"
Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
<atom:LineEdit RightAddOn="{antdicons:AntDesignIconProvider Kind=SettingOutlined}" Width="400"
HorizontalAlignment="Left"
Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
<atom:LineEdit LeftAddOn="http://" InnerRightContent=".com" Width="400" HorizontalAlignment="Left"
Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource WithClearIconTitle}"
Description="{gallery:LineEditShowCaseLangResource WithClearIconDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputWithClearIcon}" IsAllowClear="True" />
<atom:TextArea PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextTextareaWithClearIcon}" IsAllowClear="True" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource PasswordBoxTitle}"
Description="{gallery:LineEditShowCaseLangResource PasswordBoxDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputPassword}"
Width="400"
RevealPassword="False"
PasswordChar="•"
HorizontalAlignment="Left"
IsEnableRevealButton="True" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputPassword}"
Width="400"
RevealPassword="False"
HorizontalAlignment="Left"
PasswordChar="•"
IsEnableRevealButton="True"
IsAllowClear="True" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource PrefixAndSuffixTitle}"
Description="{gallery:LineEditShowCaseLangResource PrefixAndSuffixDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextEnterYourUsername}"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=UserOutlined, StrokeBrush=#D7D7D7}"
InnerRightContent="{antdicons:AntDesignIconProvider Kind=InfoCircleOutlined, StrokeBrush=#8C8C8C}" />
<atom:LineEdit InnerLeftContent="¥" InnerRightContent="RMB" />
<atom:LineEdit InnerLeftContent="¥" InnerRightContent="RMB" IsEnabled="False" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource InputStatusTitle}"
Description="{gallery:LineEditShowCaseLangResource InputStatusDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleNormal}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextErrorWithPrefix}"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" Status="Error" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarningWithPrefix}"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" Status="Warning" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" StyleVariant="Filled" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" StyleVariant="Filled" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Borderless" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Borderless" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Underlined" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Underlined" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleLeftaddonAndRightaddon}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled" Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless"
Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined"
Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" Status="Warning" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled"
Status="Warning" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless"
Status="Warning" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined"
Status="Warning" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
HorizontalAlignment="Left"
LeftAddOn="https://"
StyleVariant="Outlined"
Status="Error" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Outlined" Status="Warning" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Outlined" Status="Error"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Outlined" Status="Warning"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Error" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Warning" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Error"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Warning"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource SearchBoxTitle}"
Description="{gallery:LineEditShowCaseLangResource SearchBoxDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch" SizeType="Large" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
HorizontalAlignment="Stretch"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
IsAllowClear="True" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
HorizontalAlignment="Stretch"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextText}"
InnerRightContent="{antdicons:AntDesignIconProvider Kind=AudioOutlined, StrokeBrush=#1677ff, Width=16, Height=16}"
IsAllowClear="True"
SizeType="Large" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleFilled}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
LeftAddOn="https://"
StyleVariant="Filled" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
LeftAddOn="https://"
StyleVariant="Filled" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleBorderless}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
LeftAddOn="https://"
StyleVariant="Borderless" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
LeftAddOn="https://"
StyleVariant="Borderless" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleUnderlined}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
LeftAddOn="https://"
StyleVariant="Underlined" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" HorizontalAlignment="Stretch"
LeftAddOn="https://"
StyleVariant="Underlined" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource DisabledSearchBoxTitle}"
Description="{gallery:LineEditShowCaseLangResource DisabledSearchBoxDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left" SizeType="Large"
IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
SearchButtonStyle="Primary" SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
HorizontalAlignment="Left"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
IsAllowClear="True" IsEnabled="False" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
HorizontalAlignment="Left"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextText}"
IsAllowClear="True"
SizeType="Large" IsEnabled="False">
<atom:SearchEdit.InnerRightContent>
<antdicons:AudioOutlined Width="16" Height="16" Name="AudioOutlined">
<antdicons:AudioOutlined.Styles>
<Style Selector="atom|Icon#AudioOutlined">
<Setter Property="Foreground" Value="{atom:SharedTokenResource ColorPrimary}"/>
</Style>
</antdicons:AudioOutlined.Styles>
</antdicons:AudioOutlined>
</atom:SearchEdit.InnerRightContent>
</atom:SearchEdit>
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource SearchBoxWithLoadingTitle}"
Description="{gallery:LineEditShowCaseLangResource SearchBoxWithLoadingDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchLoadingDefault}"
Width="400"
IsOperating="True"
HorizontalAlignment="Left" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchLoadingWithEnterbutton}" Width="400"
HorizontalAlignment="Left"
IsOperating="True"
SearchButtonStyle="Primary" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
IsOperating="True"
HorizontalAlignment="Left"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}"
SizeType="Large" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource TextAreaTitle}"
Description="{gallery:LineEditShowCaseLangResource TextAreaDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:TextArea Lines="4" />
<atom:TextArea Lines="4" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextMaxlengthIsN6}" MaxLength="6" />
<atom:TextArea Lines="4" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextMaxlengthIsN6}" MaxLength="6" StyleVariant="Filled" />
<atom:TextArea Lines="4" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextDisabled}" MaxLength="6" IsEnabled="False" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource AutoSizeTextAreaTitle}"
Description="{gallery:LineEditShowCaseLangResource AutoSizeTextAreaDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:TextArea PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextAutosizeHeightBasedOnContentLines}" IsAutoSize="True" />
<atom:TextArea PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextAutosizeHeightWithMinimumAndMaximumNumberOf}" MinLines="3"
MaxLines="6" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource CharacterCountingTitle}"
Description="{gallery:LineEditShowCaseLangResource CharacterCountingDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:LineEdit IsShowCount="True" MaxLength="20" />
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextCanResize}" IsResizable="True" />
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextDisableResize}" Height="120"
IsResizable="False" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource TextAreaStatusTitle}"
Description="{gallery:LineEditShowCaseLangResource TextAreaStatusDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" IsResizable="True" Status="Error" />
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" IsResizable="True" Status="Warning"/>
</StackPanel>
</gallery:ShowCaseItem>
</gallery:ShowCasePanel>
<atom:TabControl Name="ScenarioTabs"
SizeType="Large"
SelectedIndex="0">
<atom:TabItem Header="{gallery:LineEditShowCaseLangResource ScenarioBasic}" Tag="Basic" />
<atom:TabItem Header="{gallery:LineEditShowCaseLangResource ScenarioState}" Tag="State" />
<atom:TabItem Header="{gallery:LineEditShowCaseLangResource ScenarioSearch}" Tag="Search" />
<atom:TabItem Header="{gallery:LineEditShowCaseLangResource ScenarioTextArea}" Tag="TextArea" />
</atom:TabControl>
</UserControl>
@@ -1,4 +1,4 @@
using ReactiveUI;
using Avalonia.Controls;
using ReactiveUI.Avalonia;
namespace AtomUIGallery.ShowCases.LineEdit;
@@ -7,9 +7,64 @@ public partial class LineEditShowCase : ReactiveUserControl<LineEditViewModel>
{
public const string LanguageId = nameof(LineEditShowCase);
private const string BasicScenario = "Basic";
private const string StateScenario = "State";
private const string SearchScenario = "Search";
private const string TextAreaScenario = "TextArea";
private readonly Dictionary<string, Control> _scenarioCache = new(StringComparer.Ordinal);
public LineEditShowCase()
{
this.WhenActivated(disposables => { });
InitializeComponent();
ScenarioTabs.SelectionChanged += HandleScenarioSelectionChanged;
EnsureSelectedScenarioContent();
}
protected override void OnDataContextChanged(EventArgs e)
{
base.OnDataContextChanged(e);
foreach (var content in _scenarioCache.Values)
{
content.DataContext = DataContext;
}
}
private void HandleScenarioSelectionChanged(object? sender, SelectionChangedEventArgs args)
{
EnsureSelectedScenarioContent();
}
private void EnsureSelectedScenarioContent()
{
if (ScenarioTabs.SelectedItem is not AtomUI.Desktop.Controls.TabItem tabItem ||
tabItem.Tag is not string scenario)
{
return;
}
if (!_scenarioCache.TryGetValue(scenario, out var content))
{
content = CreateScenarioContent(scenario);
content.DataContext = DataContext;
_scenarioCache.Add(scenario, content);
}
if (tabItem.Content != content)
{
tabItem.Content = content;
}
}
private static Control CreateScenarioContent(string scenario)
{
return scenario switch
{
BasicScenario => new LineEditBasicShowCase(),
StateScenario => new LineEditStateShowCase(),
SearchScenario => new LineEditSearchShowCase(),
TextAreaScenario => new LineEditTextAreaShowCase(),
_ => throw new InvalidOperationException($"Unknown LineEdit scenario: {scenario}")
};
}
}
@@ -0,0 +1,117 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="AtomUIGallery.ShowCases.LineEdit.LineEditStateShowCase"
xmlns:vm="using:AtomUIGallery.ShowCases.LineEdit"
xmlns:atom="https://atomui.net"
xmlns:antdicons="https://atomui.net/icons/antdesign"
xmlns:gallery="https://atomui.net/oss-controls/gallery"
x:DataType="vm:LineEditViewModel">
<gallery:ShowCasePanel>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource DisabledTitle}"
Description="{gallery:LineEditShowCaseLangResource DisabledDescription}">
<StackPanel Orientation="Vertical" Spacing="10">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleNormal}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextOutlined}" StyleVariant="Outlined" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBorderless}" StyleVariant="Borderless" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextUnderlined}" StyleVariant="Underlined" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextOutlined}" StyleVariant="Outlined" Status="Error" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextFilled}" StyleVariant="Filled" Status="Error" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextBorderless}" StyleVariant="Borderless" Status="Error" IsEnabled="False" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextUnderlined}" StyleVariant="Underlined" Status="Error" IsEnabled="False" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleLeftaddonAndRightaddon}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" Status="Error" IsEnabled="False" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled" Status="Error"
IsEnabled="False" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless"
Status="Error" IsEnabled="False" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined"
Status="Error" IsEnabled="False" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource InputStatusTitle}"
Description="{gallery:LineEditShowCaseLangResource InputStatusDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleNormal}" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextErrorWithPrefix}"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" Status="Error" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarningWithPrefix}"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" Status="Warning" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" StyleVariant="Filled" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}" StyleVariant="Filled" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Borderless" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Borderless" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" Status="Error"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Underlined" />
<atom:LineEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" Status="Warning"
InnerLeftContent="{antdicons:AntDesignIconProvider Kind=ClockCircleOutlined}"
StyleVariant="Underlined" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleLeftaddonAndRightaddon}" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled" Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless"
Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined"
Status="Error" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" Status="Warning" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Filled"
Status="Warning" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Borderless"
Status="Warning" />
<atom:LineEdit LeftAddOn="http://" RightAddOn=".com" Text="{gallery:LineEditShowCaseLangResource P2TextMysite}" StyleVariant="Underlined"
Status="Warning" />
<atom:Separator Title="{gallery:LineEditShowCaseLangResource P2TitleSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}"
Width="400"
HorizontalAlignment="Left"
LeftAddOn="https://"
StyleVariant="Outlined"
Status="Error" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Outlined" Status="Warning" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Outlined" Status="Error"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Outlined" Status="Warning"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Error" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Warning" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Error"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
<atom:SearchEdit PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextInputSearchText}" Width="400" HorizontalAlignment="Left"
LeftAddOn="https://" StyleVariant="Filled" Status="Warning"
SearchButtonStyle="Primary"
SearchButtonText="{gallery:LineEditShowCaseLangResource P2SearchButtonTextSearch}" />
</StackPanel>
</gallery:ShowCaseItem>
</gallery:ShowCasePanel>
</UserControl>
@@ -0,0 +1,11 @@
using ReactiveUI.Avalonia;
namespace AtomUIGallery.ShowCases.LineEdit;
public partial class LineEditStateShowCase : ReactiveUserControl<LineEditViewModel>
{
public LineEditStateShowCase()
{
InitializeComponent();
}
}
@@ -0,0 +1,50 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="AtomUIGallery.ShowCases.LineEdit.LineEditTextAreaShowCase"
xmlns:vm="using:AtomUIGallery.ShowCases.LineEdit"
xmlns:atom="https://atomui.net"
xmlns:gallery="https://atomui.net/oss-controls/gallery"
x:DataType="vm:LineEditViewModel">
<gallery:ShowCasePanel>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource TextAreaTitle}"
Description="{gallery:LineEditShowCaseLangResource TextAreaDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:TextArea Lines="4" />
<atom:TextArea Lines="4" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextMaxlengthIsN6}" MaxLength="6" />
<atom:TextArea Lines="4" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextMaxlengthIsN6}" MaxLength="6" StyleVariant="Filled" />
<atom:TextArea Lines="4" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextDisabled}" MaxLength="6" IsEnabled="False" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource AutoSizeTextAreaTitle}"
Description="{gallery:LineEditShowCaseLangResource AutoSizeTextAreaDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:TextArea PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextAutosizeHeightBasedOnContentLines}" IsAutoSize="True" />
<atom:TextArea PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextAutosizeHeightWithMinimumAndMaximumNumberOf}" MinLines="3"
MaxLines="6" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource CharacterCountingTitle}"
Description="{gallery:LineEditShowCaseLangResource CharacterCountingDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:LineEdit IsShowCount="True" MaxLength="20" />
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextCanResize}" IsResizable="True" />
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextDisableResize}" Height="120"
IsResizable="False" />
</StackPanel>
</gallery:ShowCaseItem>
<gallery:ShowCaseItem
Title="{gallery:LineEditShowCaseLangResource TextAreaStatusTitle}"
Description="{gallery:LineEditShowCaseLangResource TextAreaStatusDescription}">
<StackPanel Orientation="Vertical" Spacing="10" Margin="0, 0, 20, 0">
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextError}" IsResizable="True" Status="Error" />
<atom:TextArea IsShowCount="True" MaxLength="100" PlaceholderText="{gallery:LineEditShowCaseLangResource P2PlaceholderTextWarning}" IsResizable="True" Status="Warning"/>
</StackPanel>
</gallery:ShowCaseItem>
</gallery:ShowCasePanel>
</UserControl>
@@ -0,0 +1,11 @@
using ReactiveUI.Avalonia;
namespace AtomUIGallery.ShowCases.LineEdit;
public partial class LineEditTextAreaShowCase : ReactiveUserControl<LineEditViewModel>
{
public LineEditTextAreaShowCase()
{
InitializeComponent();
}
}