!7 ShowCaseItem样式添加圆角&部分文案错误&Separator使用AtomUI的

Merge pull request !7 from ruoyu/ruoyu/changeShowCaseItem
This commit is contained in:
pulsarware 2024-08-28 01:11:46 +00:00 committed by Gitee
commit a2752934aa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 16 additions and 24 deletions

View File

@ -15,37 +15,29 @@ public class ShowCaseItem : ContentControl
private void SetupUi()
{
var mainLayout = new StackPanel();
var showCaseTitle = new StackPanel
var showCaseTitle = new AtomUI.Controls.Separator()
{
Orientation = Orientation.Horizontal,
Margin = new Thickness(0, 30, 0, 0)
Title = Title,
TitlePosition = AtomUI.Controls.SeparatorTitlePosition.Left,
FontWeight = FontWeight.Bold,
};
showCaseTitle.Children.Add(new Label()
{
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left,
Content = Title,
FontWeight = FontWeight.Bold
});
showCaseTitle.Children.Add(new Separator()
{
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Stretch,
Margin = new Thickness(10, 0),
Width = 200,
BorderBrush = new SolidColorBrush(Colors.Gray),
});
if (Content is Control contentControl) {
LogicalChildren.Remove(contentControl);
mainLayout.Children.Add(contentControl);
}
mainLayout.Children.Add(new Border
{
Height = 10,
Background = Brushes.Transparent
});
mainLayout.Children.Add(showCaseTitle);
mainLayout.Children.Add(new TextBlock()
{
Text = Description,
TextWrapping = TextWrapping.Wrap
TextWrapping = TextWrapping.Wrap,
Margin = new Thickness(0, 10, 0, 0)
});
var outerBorder = new Border()
@ -53,7 +45,8 @@ public class ShowCaseItem : ContentControl
BorderBrush = new SolidColorBrush(new Color(10, 5, 5, 5)),
BorderThickness = new Thickness(1),
Padding = new Thickness(20),
Child = mainLayout
Child = mainLayout,
CornerRadius = new CornerRadius(8)
};
Content = outerBorder;

View File

@ -54,7 +54,7 @@
Title="Size"
Description="AtomUI supports three sizes of buttons: small, default and large.
If a large or small button is desired, set the size property to either large or small respectively. Omit the size property for a button with the default size.">
<DockPanel Margin="0, 0, 0, 0" Height="300">
<DockPanel Margin="0, 0, 0, 0">
<StackPanel Orientation="Horizontal" Spacing="5" DockPanel.Dock="Top">
<TextBlock VerticalAlignment="Center">Expand direction:</TextBlock>
<atom:OptionButtonGroup ButtonStyle="Outline" Name="ButtonSizeTypeOptionGroup">

View File

@ -87,7 +87,6 @@
Check all
</atom:CheckBox>
</StackPanel>
<Separator Width="200" />
<WrapPanel Margin="0, 20, 0, 0">
<atom:CheckBox x:Name="AppleCheckBox"
IsChecked="{Binding AppleCheckedStatus}"

View File

@ -73,7 +73,7 @@
<TextBlock TextWrapping="Wrap">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
</TextBlock>
<atom:Separator Title="Left Text" TitlePosition="Right"/>
<atom:Separator Title="Right Text" TitlePosition="Right"/>
<TextBlock TextWrapping="Wrap">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
</TextBlock>