public IStatusBarTextItem GetOrCreateStatusBarTextItem(string guid, GridChildLength gridChildLength, int sort) { if (!(Children.FirstOrDefault(p => p.GUID == guid) is IStatusBarTextItem item)) { item = CreateStatusBarTextItem(guid); StatusBarService.Current.AddStatusBarItem(item, gridChildLength, sort); item.Margin = new Thickness(12, 0, 12, 0); } return(item); }
public void AddStatusBarItem(IStatusBarObjectItem item, GridChildLength gridChildLength, int index = -1) { if (item == null) { throw new ArgumentNullException(nameof(item)); } _items.Add(item); try { _stackGrid.AddChild(item, gridChildLength, index); } catch (Exception ex) { LoggerService.WriteCallerLine(ex.Message); } }
public void AddChild(TStackItem child, GridChildLength gridChildLength, int index = -1) { if (index < 0) { index = 0; } _children.Add(new StackItemCell { StackItem = child, GridChildLength = gridChildLength, Order = index }); UpdateGrid(); }
public static IStatusBarTextItem GetOrCreateStatusBarTextItem(string guid, GridChildLength gridChildLength, int sort) => Current.GetOrCreateStatusBarTextItem(guid, gridChildLength, sort);