From 9319fe76c56b79e0933c09280fe32658c2f176c7 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 5 Apr 2024 19:01:39 +0200 Subject: Cleanup, work on index2, some tooling updates --- MatrixUtils.Desktop/Components/NavigationStack.axaml.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'MatrixUtils.Desktop/Components/NavigationStack.axaml.cs') diff --git a/MatrixUtils.Desktop/Components/NavigationStack.axaml.cs b/MatrixUtils.Desktop/Components/NavigationStack.axaml.cs index 632ae3c..4e962a7 100644 --- a/MatrixUtils.Desktop/Components/NavigationStack.axaml.cs +++ b/MatrixUtils.Desktop/Components/NavigationStack.axaml.cs @@ -10,23 +10,24 @@ public partial class NavigationStack : UserControl { } // private void InitializeComponent() { - // AvaloniaXamlLoader.Load(this); - // buildView(); + // AvaloniaXamlLoader.Load(this); + // buildView(); // } protected override void OnLoaded(RoutedEventArgs e) { base.OnLoaded(e); buildView(); } - + private void buildView() { if (navPanel is null) { Console.WriteLine("NavigationStack buildView called while navpanel is null!"); // await Task.Delay(100); // if (navPanel is null) - // await buildView(); + // await buildView(); // else Console.WriteLine("navpanel is not null!"); } + navPanel.Children.Clear(); foreach (var item in _stack) { Button btn = new() { @@ -38,10 +39,10 @@ public partial class NavigationStack : UserControl { }; navPanel.Children.Add(btn); } + content.Content = Current?.View ?? new UserControl(); } - public class NavigationStackItem { public string Name { get; set; } public string Description { get; set; } = ""; @@ -69,4 +70,4 @@ public partial class NavigationStack : UserControl { _stack.RemoveRange(index, _stack.Count - index); buildView(); } -} +} \ No newline at end of file -- cgit 1.4.1