From 3a0e9e1cf828b6fcad79927c29f16b5567dfcd02 Mon Sep 17 00:00:00 2001 From: chenxuuu Date: Fri, 26 Apr 2024 18:06:57 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=A0=87=E9=A2=98=E6=A0=8F=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LLCOM/ViewModels/MainWindowViewModel.cs | 17 +++++++++++++++-- llcomNext/LLCOM/Views/MainWindow.axaml | 10 +--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/llcomNext/LLCOM/ViewModels/MainWindowViewModel.cs b/llcomNext/LLCOM/ViewModels/MainWindowViewModel.cs index 15e17c8..b8fd6e6 100644 --- a/llcomNext/LLCOM/ViewModels/MainWindowViewModel.cs +++ b/llcomNext/LLCOM/ViewModels/MainWindowViewModel.cs @@ -1,7 +1,20 @@ -namespace LLCOM.ViewModels +using CommunityToolkit.Mvvm.ComponentModel; +using System.Threading.Tasks; + +namespace LLCOM.ViewModels { + public partial class MainWindowViewModel : ViewModelBase { - public string Greeting => "Welcome to Avalonia!"; + /// + /// 标题栏 + /// + [ObservableProperty] + public string _title = "LLCOM - Next"; + + public MainWindowViewModel() + { + + } } } \ No newline at end of file diff --git a/llcomNext/LLCOM/Views/MainWindow.axaml b/llcomNext/LLCOM/Views/MainWindow.axaml index c73f16b..124a158 100644 --- a/llcomNext/LLCOM/Views/MainWindow.axaml +++ b/llcomNext/LLCOM/Views/MainWindow.axaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:LLCOM.ViewModels" - Title="LLCOM - Next" + Title="{Binding Title}" d:DesignHeight="450" d:DesignWidth="800" x:DataType="vm:MainWindowViewModel" @@ -14,16 +14,8 @@ mc:Ignorable="d"> - -