[#20][#80] MemberAdminWindow: Update business share status bar tool tip
Test / Run tests (push) Successful in 2m1s
Test / Run tests (push) Successful in 2m1s
This commit is contained in:
@@ -4,11 +4,14 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.IO.Hashing;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Elwig.Helpers {
|
||||
public static partial class Extensions {
|
||||
@@ -145,5 +148,28 @@ namespace Elwig.Helpers {
|
||||
}
|
||||
return [.. list];
|
||||
}
|
||||
|
||||
public static IEnumerable<T> Join<T>(this IEnumerable<T> src, Func<T> separatorFactory) {
|
||||
var srcArr = src.ToArray();
|
||||
for (int i = 0; i < srcArr.Length; i++) {
|
||||
yield return srcArr[i];
|
||||
if (i < srcArr.Length - 1) {
|
||||
yield return separatorFactory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddToolTipCell(this Grid grid, string text, int row, int col, int colSpan = 1, bool bold = false, bool alignRight = false, bool alignCenter = false) {
|
||||
var tb = new TextBlock() {
|
||||
Text = text,
|
||||
TextAlignment = alignRight ? TextAlignment.Right : alignCenter ? TextAlignment.Center : TextAlignment.Left,
|
||||
Margin = new(0, 12 * row, 0, 0),
|
||||
FontWeight = bold ? FontWeights.Bold : FontWeights.Normal,
|
||||
};
|
||||
tb.SetValue(Grid.ColumnProperty, col);
|
||||
tb.SetValue(Grid.ColumnSpanProperty, colSpan);
|
||||
grid.Children.Add(tb);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user