Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/numericupdown control #1022

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput;

public class NumericUpDownViewModel : ObservableObject
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public partial class MainWindowViewModel(IStringLocalizer<Translations> localize
new NavigationViewItem(nameof(ToggleSwitch), typeof(ToggleSwitchPage)),
new NavigationViewItem(nameof(CheckBox), typeof(CheckBoxPage)),
new NavigationViewItem(nameof(ComboBox), typeof(ComboBoxPage)),
new NavigationViewItem(nameof(NumericUpDown), typeof(NumericUpDownPage)),
new NavigationViewItem(nameof(RadioButton), typeof(RadioButtonPage)),
new NavigationViewItem(nameof(RatingControl), typeof(RatingPage)),
new NavigationViewItem(nameof(ThumbRate), typeof(ThumbRatePage)),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<Page
x:Class="Wpf.Ui.Gallery.Views.Pages.BasicInput.NumericUpDownPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Wpf.Ui.Gallery.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf.Ui.Gallery.Views.Pages.BasicInput"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="RatingPage"
controls:PageControlDocumentation.DocumentationType="{x:Type ui:NumericUpDown}"
d:DataContext="{d:DesignInstance local:NumericUpDownPage,
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignWidth="800"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">

<StackPanel Margin="0,0,0,24">
<controls:ControlExample Margin="0" HeaderText="WPF UI NumericUpDown">
<controls:ControlExample.XamlCode>
&lt;ui:NumericUpDown
BorderThickness=&quot;1&quot;
ButtonAlignment=&quot;Vertical&quot;
ButtonWidth=&quot;22&quot;
CornerRadius=&quot;4&quot;
Decimals=&quot;0&quot;
Format=&quot;N0&quot;
IsEnabled=&quot;True&quot;
IsReadOnly=&quot;False&quot;
MaxValue=&quot;1000000&quot;
MinValue=&quot;0&quot;
Step=&quot;1&quot;
Wrap=&quot;True&quot;
Value=&quot;999999&quot; /&gt;
</controls:ControlExample.XamlCode>

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:NumericUpDown
Width="150"
Padding="4"
HorizontalAlignment="Left"
BorderThickness="1"
ButtonAlignment="Vertical"
ButtonWidth="22"
CornerRadius="4"
Decimals="0"
Format="N0"
IsEnabled="True"
IsReadOnly="False"
MaxValue="1000000"
MinValue="0"
Step="1"
Wrap="True"
Value="999999" />
</Grid>
</controls:ControlExample>

</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using Wpf.Ui.Controls;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.ViewModels.Pages.BasicInput;

namespace Wpf.Ui.Gallery.Views.Pages.BasicInput;

[GalleryPage("NumericUpDown control", SymbolRegular.NumberSymbol16)]
public partial class NumericUpDownPage : INavigableView<NumericUpDownViewModel>
{
public NumericUpDownViewModel ViewModel { get; }

public NumericUpDownPage(NumericUpDownViewModel viewModel)
{
ViewModel = viewModel;
DataContext = this;

InitializeComponent();
}
}
Loading