Merge pull request #66 from irihitech/numeric
New Control: NumericUpDown family
This commit is contained in:
@@ -15,6 +15,7 @@ public static class MenuKeys
|
||||
public const string MenuKeyLoading = "Loading";
|
||||
public const string MenuKeyMessageBox = "MessageBox";
|
||||
public const string MenuKeyNavigation = "Navigation";
|
||||
public const string MenuKeyNumericUpDown = "NumericUpDown";
|
||||
public const string MenuKeyPagination = "Pagination";
|
||||
public const string MenuKeyTagInput = "TagInput";
|
||||
public const string MenuKeyTimeline = "Timeline";
|
||||
|
||||
26
demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml
Normal file
26
demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<UserControl
|
||||
x:Class="Ursa.Demo.Pages.NumericUpDownDemo"
|
||||
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"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Styles>
|
||||
<Style Selector=":is(u|NumericUpDown)">
|
||||
<Setter Property="Width" Value="240"></Setter>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<u:NumericIntUpDown Name="input" InnerLeftContent="Age" Step="1" Value="2" Watermark="Input Value" Classes="ClearButton" />
|
||||
<TextBlock Text="{Binding #input.Value}" ></TextBlock>
|
||||
<u:NumericDoubleUpDown Name="inputDouble" Step="0.5" Value="3.1" EmptyInputValue="1"></u:NumericDoubleUpDown>
|
||||
<TextBlock Text="{Binding #inputDouble.Value}"></TextBlock>
|
||||
<u:NumericByteUpDown Name="inputByte" Step="1" Value="3" EmptyInputValue="1"></u:NumericByteUpDown>
|
||||
<TextBlock Text="{Binding #inputByte.Value}"></TextBlock>
|
||||
<TextBlock Text="Drag"></TextBlock>
|
||||
<u:NumericIntUpDown Step="1" Value="2" Watermark="Input Value" AllowDrag="True" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
15
demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml.cs
Normal file
15
demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Ursa.Demo.ViewModels;
|
||||
|
||||
namespace Ursa.Demo.Pages;
|
||||
|
||||
public partial class NumericUpDownDemo : UserControl
|
||||
{
|
||||
public NumericUpDownDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new NumericUpDownDemoViewModel();
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public class MainViewViewModel : ViewModelBase
|
||||
MenuKeys.MenuKeyLoading => new LoadingDemoViewModel(),
|
||||
MenuKeys.MenuKeyMessageBox => new MessageBoxDemoViewModel(),
|
||||
MenuKeys.MenuKeyNavigation => new NavigationMenuDemoViewModel(),
|
||||
MenuKeys.MenuKeyNumericUpDown => new NumericUpDownDemoViewModel(),
|
||||
MenuKeys.MenuKeyPagination => new PaginationDemoViewModel(),
|
||||
MenuKeys.MenuKeyTagInput => new TagInputDemoViewModel(),
|
||||
MenuKeys.MenuKeyTimeline => new TimelineDemoViewModel(),
|
||||
|
||||
@@ -24,6 +24,7 @@ public class MenuViewModel: ViewModelBase
|
||||
new() { MenuHeader = "Loading", Key = MenuKeys.MenuKeyLoading },
|
||||
new() { MenuHeader = "Message Box", Key = MenuKeys.MenuKeyMessageBox },
|
||||
new() { MenuHeader = "Navigation", Key = MenuKeys.MenuKeyNavigation },
|
||||
new() { MenuHeader = "NumericUpDown", Key = MenuKeys.MenuKeyNumericUpDown },
|
||||
new() { MenuHeader = "Pagination", Key = MenuKeys.MenuKeyPagination },
|
||||
new() { MenuHeader = "TagInput", Key = MenuKeys.MenuKeyTagInput },
|
||||
new() { MenuHeader = "Timeline", Key = MenuKeys.MenuKeyTimeline },
|
||||
|
||||
8
demo/Ursa.Demo/ViewModels/NumericUpDownDemoViewModel.cs
Normal file
8
demo/Ursa.Demo/ViewModels/NumericUpDownDemoViewModel.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class NumericUpDownDemoViewModel: ObservableObject
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user