From ec5fb3f3ad6fbdf80a393e5136ae99580b7ba558 Mon Sep 17 00:00:00 2001 From: Zhuyahong Date: Sun, 6 Nov 2022 14:49:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0Usercontrol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LoraGamepad/ViewModels/MainWindowViewModel.cs | 10 +++++++++- LoraGamepad/ViewModels/TProViewModel.cs | 9 +++++++++ LoraGamepad/ViewModels/TProWindowViewModel.cs | 6 ------ LoraGamepad/Views/MainWindow.axaml | 6 +++--- LoraGamepad/Views/TProView.axaml | 17 +++++++++++++++++ .../{TProWindow.axaml.cs => TProView.axaml.cs} | 7 ++----- LoraGamepad/Views/TProWindow.axaml | 9 --------- 7 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 LoraGamepad/ViewModels/TProViewModel.cs delete mode 100644 LoraGamepad/ViewModels/TProWindowViewModel.cs create mode 100644 LoraGamepad/Views/TProView.axaml rename LoraGamepad/Views/{TProWindow.axaml.cs => TProView.axaml.cs} (67%) delete mode 100644 LoraGamepad/Views/TProWindow.axaml diff --git a/LoraGamepad/ViewModels/MainWindowViewModel.cs b/LoraGamepad/ViewModels/MainWindowViewModel.cs index 006a88b..98d056f 100644 --- a/LoraGamepad/ViewModels/MainWindowViewModel.cs +++ b/LoraGamepad/ViewModels/MainWindowViewModel.cs @@ -1,7 +1,15 @@ namespace LoraGamepad.ViewModels { + public class MainWindowViewModel : ViewModelBase { - public string Greeting => "Welcome to Avalonia!"; + + public TProViewModel TProViewModels { get; } + + public MainWindowViewModel() + { + TProViewModels = new TProViewModel(); + } } + } \ No newline at end of file diff --git a/LoraGamepad/ViewModels/TProViewModel.cs b/LoraGamepad/ViewModels/TProViewModel.cs new file mode 100644 index 0000000..6225350 --- /dev/null +++ b/LoraGamepad/ViewModels/TProViewModel.cs @@ -0,0 +1,9 @@ +namespace LoraGamepad.ViewModels; + +public class TProViewModel : ViewModelBase +{ + public TProViewModel() + { + + } +} \ No newline at end of file diff --git a/LoraGamepad/ViewModels/TProWindowViewModel.cs b/LoraGamepad/ViewModels/TProWindowViewModel.cs deleted file mode 100644 index 2ad6c22..0000000 --- a/LoraGamepad/ViewModels/TProWindowViewModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace LoraGamepad.ViewModels; - -public class TPROWindowViewModel -{ - -} \ No newline at end of file diff --git a/LoraGamepad/Views/MainWindow.axaml b/LoraGamepad/Views/MainWindow.axaml index bb3b94c..acb3e3b 100644 --- a/LoraGamepad/Views/MainWindow.axaml +++ b/LoraGamepad/Views/MainWindow.axaml @@ -1,6 +1,7 @@ - - - + + diff --git a/LoraGamepad/Views/TProView.axaml b/LoraGamepad/Views/TProView.axaml new file mode 100644 index 0000000..8b6835e --- /dev/null +++ b/LoraGamepad/Views/TProView.axaml @@ -0,0 +1,17 @@ + + + + + Walk the dog + Buy some milk + + + diff --git a/LoraGamepad/Views/TProWindow.axaml.cs b/LoraGamepad/Views/TProView.axaml.cs similarity index 67% rename from LoraGamepad/Views/TProWindow.axaml.cs rename to LoraGamepad/Views/TProView.axaml.cs index 5a18c74..6863534 100644 --- a/LoraGamepad/Views/TProWindow.axaml.cs +++ b/LoraGamepad/Views/TProView.axaml.cs @@ -4,14 +4,11 @@ using Avalonia.Markup.Xaml; namespace LoraGamepad.Views; -public partial class TPROWindow : Window +public partial class TProView : UserControl { - public TPROWindow() + public TProView() { InitializeComponent(); -#if DEBUG - this.AttachDevTools(); -#endif } private void InitializeComponent() diff --git a/LoraGamepad/Views/TProWindow.axaml b/LoraGamepad/Views/TProWindow.axaml deleted file mode 100644 index 3bffd45..0000000 --- a/LoraGamepad/Views/TProWindow.axaml +++ /dev/null @@ -1,9 +0,0 @@ - - Welcome to Avalonia! -