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 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 } }; } } }