20230724_MBJC_upperpc/Model/FirstWindowModel.cs
2023-12-18 17:31:28 +08:00

32 lines
996 B
C#

using _20230724_MBJC_upperpc.Common;
using _20230724_MBJC_upperpc.Domain;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
namespace _20230724_MBJC_upperpc.Model
{
public class FirstWindowModel
{
public ObservableCollection<CustomTab> CustomTabs { get; }
public CustomTab? SelectedTab { get; set; }
public FirstWindowModel()
{
Type type = Type.GetType("_20230724_MBJC_upperpc.Views.FirstPageView");
//Type type = Type.GetType("_20230724_MBJC_upperpc.Views.SecondPageView");
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
FrameworkElement page = (FrameworkElement)cti.Invoke(null);
CustomTabs = new() { new CustomTab { CustomHeader = "首页", PageContent = page } };
}
}
}