Merge pull request #265 from irihitech/calendar
CalendarView and DatePicker and DateRangePicker
This commit is contained in:
14
demo/Ursa.Demo/Pages/DatePickerDemo.axaml
Normal file
14
demo/Ursa.Demo/Pages/DatePickerDemo.axaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<UserControl 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"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Ursa.Demo.Pages.DatePickerDemo">
|
||||
<StackPanel Margin="20" HorizontalAlignment="Left">
|
||||
<u:CalendarView DateSelected="CalendarView_OnOnDateSelected" DatePreviewed="CalendarView_OnOnDatePreviewed"/>
|
||||
<TextBlock Text="{Binding #singlePicker.SelectedDate}" ></TextBlock>
|
||||
<u:DatePicker Name="singlePicker" Width="200" />
|
||||
<u:DateRangePicker Width="300" DisplayFormat="yyyyMMdd" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
25
demo/Ursa.Demo/Pages/DatePickerDemo.axaml.cs
Normal file
25
demo/Ursa.Demo/Pages/DatePickerDemo.axaml.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Diagnostics;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Ursa.Controls;
|
||||
|
||||
namespace Ursa.Demo.Pages;
|
||||
|
||||
public partial class DatePickerDemo : UserControl
|
||||
{
|
||||
public DatePickerDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CalendarView_OnOnDateSelected(object? sender, CalendarDayButtonEventArgs e)
|
||||
{
|
||||
Debug.WriteLine("Pressed: "+ e.Date?.ToLongDateString());
|
||||
}
|
||||
|
||||
private void CalendarView_OnOnDatePreviewed(object? sender, CalendarDayButtonEventArgs e)
|
||||
{
|
||||
Debug.WriteLine("Hovered: "+e.Date?.ToLongDateString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user