feat: add form infra.
This commit is contained in:
25
src/Ursa/Controls/Form/Form.cs
Normal file
25
src/Ursa/Controls/Form/Form.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Collections;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml.Templates;
|
||||||
|
using Avalonia.Metadata;
|
||||||
|
|
||||||
|
namespace Ursa.Controls;
|
||||||
|
|
||||||
|
public class Form: ItemsControl
|
||||||
|
{
|
||||||
|
|
||||||
|
public static readonly StyledProperty<AvaloniaList<FormItem>> ItemsProperty = AvaloniaProperty.Register<Form, AvaloniaList<FormItem>>(
|
||||||
|
"Items");
|
||||||
|
|
||||||
|
public AvaloniaList<FormItem> Items
|
||||||
|
{
|
||||||
|
get => GetValue(ItemsProperty);
|
||||||
|
set => SetValue(ItemsProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddChild(object child)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
src/Ursa/Controls/Form/FormGroup.cs
Normal file
9
src/Ursa/Controls/Form/FormGroup.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Controls.Primitives;
|
||||||
|
|
||||||
|
namespace Ursa.Controls;
|
||||||
|
|
||||||
|
public class FormGroup: HeaderedItemsControl, IFormItem
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
8
src/Ursa/Controls/Form/FormItem.cs
Normal file
8
src/Ursa/Controls/Form/FormItem.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using Avalonia.Controls.Primitives;
|
||||||
|
|
||||||
|
namespace Ursa.Controls;
|
||||||
|
|
||||||
|
public class FormItem: TemplatedControl, IFormItem
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
6
src/Ursa/Controls/Form/FormPanel.cs
Normal file
6
src/Ursa/Controls/Form/FormPanel.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Ursa.Controls;
|
||||||
|
|
||||||
|
public class FormPanel
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
9
src/Ursa/Controls/Form/IFormItem.cs
Normal file
9
src/Ursa/Controls/Form/IFormItem.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Controls.Primitives;
|
||||||
|
|
||||||
|
namespace Ursa.Controls;
|
||||||
|
|
||||||
|
public interface IFormItem
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user