Empty text in middle column, textalign center
This commit is contained in:
@@ -143,7 +143,28 @@ public class MainWindow
|
|||||||
ChildInitializer =
|
ChildInitializer =
|
||||||
{
|
{
|
||||||
ParentsItemsView().WithExtension(new GridPositionExtension(0, 0)),
|
ParentsItemsView().WithExtension(new GridPositionExtension(0, 0)),
|
||||||
SelectedItemsView().WithExtension(new GridPositionExtension(1, 0)),
|
new Grid<IRootViewModel>
|
||||||
|
{
|
||||||
|
Extensions =
|
||||||
|
{
|
||||||
|
new GridPositionExtension(1, 0)
|
||||||
|
},
|
||||||
|
ChildInitializer =
|
||||||
|
{
|
||||||
|
SelectedItemsView(),
|
||||||
|
new TextBlock<IRootViewModel>
|
||||||
|
{
|
||||||
|
Text = "Empty",
|
||||||
|
Foreground = _theme.ErrorForegroundColor,
|
||||||
|
TextAlignment = TextAlignment.Center
|
||||||
|
}.Setup(t => t.Bind(
|
||||||
|
t,
|
||||||
|
dc => dc.AppState.SelectedTab.Value.CurrentItems.Value.Count == 0,
|
||||||
|
t => t.IsVisible,
|
||||||
|
fallbackValue: true
|
||||||
|
))
|
||||||
|
}
|
||||||
|
},
|
||||||
new Grid<IRootViewModel>
|
new Grid<IRootViewModel>
|
||||||
{
|
{
|
||||||
Extensions =
|
Extensions =
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ public sealed partial class TextBlock<T> : View<TextBlock<T>, T>, IDisplayView
|
|||||||
=> TextAlignment switch
|
=> TextAlignment switch
|
||||||
{
|
{
|
||||||
TextAlignment.Right => string.Format($"{{0,{size.Width}}}", text),
|
TextAlignment.Right => string.Format($"{{0,{size.Width}}}", text),
|
||||||
|
TextAlignment.Center => string.Format($"{{0,{(size.Width - text.Length) / 2 + text.Length}}}", text),
|
||||||
_ => text
|
_ => text
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user