首次提交:添加src文件夹代码
This commit is contained in:
56
Cowain.Bake.UI/Helper/ViewModels/AboutWindowViewModel.cs
Normal file
56
Cowain.Bake.UI/Helper/ViewModels/AboutWindowViewModel.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Cowain.Bake.Common;
|
||||
using Cowain.Bake.Common.Core;
|
||||
using Prism.Regions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Unity;
|
||||
|
||||
namespace Cowain.Bake.UI.Helper.ViewModels
|
||||
{
|
||||
public class AboutWindowViewModel : ViewModelBase
|
||||
{
|
||||
private string windowTitle = $"About - {Global.VS}";
|
||||
public string WindowTitle
|
||||
{
|
||||
get => windowTitle;
|
||||
set => SetProperty(ref windowTitle, value);
|
||||
}
|
||||
|
||||
private string heading = $"{SettingProvider.Instance.ProductionLineName}";
|
||||
public string Heading
|
||||
{
|
||||
get => heading;
|
||||
set => SetProperty(ref heading, value);
|
||||
}
|
||||
private string notes ;
|
||||
public string Notes
|
||||
{
|
||||
get => notes;
|
||||
set => SetProperty(ref notes, value);
|
||||
}
|
||||
|
||||
public AboutWindowViewModel(IUnityContainer unityContainer, IRegionManager regionManager) : base(unityContainer, regionManager)
|
||||
{
|
||||
this.PageTitle = "文件版本";
|
||||
LoadData();
|
||||
}
|
||||
|
||||
public void LoadData()
|
||||
{
|
||||
string content = File.ReadAllText("Notes.txt");
|
||||
if (content != null)
|
||||
{
|
||||
Notes = content;
|
||||
}
|
||||
else
|
||||
{
|
||||
Notes = "No release notes available.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user