public MainWindow() { InitializeComponent(); this.Loaded += (sender,e) => EventCollection(); visiblePanel = PlayerPanel; api = API.GetInstance(); }
/// <summary> /// 获取API对象,单例模式 /// </summary> /// <returns>返回API实例</returns> public static API GetInstance() { if (api == null) api = new API(); return api; }