mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-25 19:06:34 +08:00
feat: add Slider infra, add horizontal styles. Add tooltip as variation.
This commit is contained in:
38
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml
Normal file
38
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml
Normal file
@@ -0,0 +1,38 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.SliderDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel
|
||||
Margin="20"
|
||||
HorizontalAlignment="Left"
|
||||
Spacing="20">
|
||||
<Slider
|
||||
Width="300"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Width="300"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
TickPlacement="Outside"
|
||||
Value="0" />
|
||||
<Slider
|
||||
Width="300"
|
||||
Classes="ToolTip"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10"
|
||||
TickPlacement="Outside"
|
||||
Value="0" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml.cs
Normal file
18
demo/Semi.Avalonia.Demo/Pages/SliderDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class SliderDemo : UserControl
|
||||
{
|
||||
public SliderDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,9 @@
|
||||
<TabItem Header="RepeatButton">
|
||||
<pages:RepeatButtonDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="Slider">
|
||||
<pages:SliderDemo />
|
||||
</TabItem>
|
||||
<TabItem Header="TabControl">
|
||||
<pages:TabControlDemo />
|
||||
</TabItem>
|
||||
|
||||
Reference in New Issue
Block a user