feat: 添加Usercontrol
parent
8c69aed40f
commit
ec5fb3f3ad
|
@ -1,7 +1,15 @@
|
||||||
namespace LoraGamepad.ViewModels
|
namespace LoraGamepad.ViewModels
|
||||||
{
|
{
|
||||||
|
|
||||||
public class MainWindowViewModel : ViewModelBase
|
public class MainWindowViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
public string Greeting => "Welcome to Avalonia!";
|
|
||||||
|
public TProViewModel TProViewModels { get; }
|
||||||
|
|
||||||
|
public MainWindowViewModel()
|
||||||
|
{
|
||||||
|
TProViewModels = new TProViewModel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace LoraGamepad.ViewModels;
|
||||||
|
|
||||||
|
public class TProViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
public TProViewModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +0,0 @@
|
||||||
namespace LoraGamepad.ViewModels;
|
|
||||||
|
|
||||||
public class TPROWindowViewModel
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
<Window xmlns="https://github.com/avaloniaui"
|
<Window xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:vm="using:LoraGamepad.ViewModels"
|
xmlns:vm="using:LoraGamepad.ViewModels"
|
||||||
|
xmlns:views="clr-namespace:LoraGamepad.Views"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
@ -11,7 +12,6 @@
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<vm:MainWindowViewModel/>
|
<vm:MainWindowViewModel/>
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
|
||||||
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<ContentControl Content="{Binding TProViewModels}" />
|
||||||
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<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"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="LoraGamepad.Views.TProView">
|
||||||
|
<DockPanel>
|
||||||
|
<Button DockPanel.Dock="Bottom"
|
||||||
|
HorizontalAlignment="Center">
|
||||||
|
Add an item
|
||||||
|
</Button>
|
||||||
|
<StackPanel>
|
||||||
|
<CheckBox Margin="4">Walk the dog</CheckBox>
|
||||||
|
<CheckBox Margin="4">Buy some milk</CheckBox>
|
||||||
|
</StackPanel>
|
||||||
|
</DockPanel>
|
||||||
|
</UserControl>
|
|
@ -4,14 +4,11 @@ using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
namespace LoraGamepad.Views;
|
namespace LoraGamepad.Views;
|
||||||
|
|
||||||
public partial class TPROWindow : Window
|
public partial class TProView : UserControl
|
||||||
{
|
{
|
||||||
public TPROWindow()
|
public TProView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
#if DEBUG
|
|
||||||
this.AttachDevTools();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
|
@ -1,9 +0,0 @@
|
||||||
<Window 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"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
||||||
x:Class="LoraGamepad.Views.TPROWindow"
|
|
||||||
Title="TPROWindow">
|
|
||||||
Welcome to Avalonia!
|
|
||||||
</Window>
|
|
Loading…
Reference in New Issue