/// <summary> /// Method to Quickly Setup TabItem /// </summary> /// <param name="_header"></param> /// <param name="_isClosedEnabled"></param> /// <param name="_tab"></param> public void SetupTab(string _header, bool _isClosedEnabled, TabControl _tab) { //Create a new TabItem TabItem = new DocumentTabItem(_header, _isClosedEnabled, this, _tab); //Focus on the Tab TabItem.Focus(); this.Focus(); }
public void SetupTab(string _header, TabControl _tab, Action _closeMethod) { //Create a new TabItem TabItem = new DocumentTabItem(_header, this, _tab); //Close Method TabItem.Closed += (sender, e) => { _closeMethod.Invoke(); }; //Focus on the Tab TabItem.Focus(); this.Focus(); }
/// <summary> /// Load File and Setup TabMethod /// </summary> /// <param name="_tab">TabItem</param> /// <param name="_fileName">FileName</param> /// <param name="__method">Close Method</param> public void SetupTab(TabControl _tab, FileInfo _info, Action __method) { FileInfo = _info; FileLocation = _info.FullName; //Create a new TabItem TabItem = new DocumentTabItem(_info.Name, this, _tab); FileLocation = _info.FullName; //Close Method TabItem.Closed += (sender, e) => { __method?.Invoke(); }; //Focus on the Tab TabItem.Focus(); this.Focus(); }