|
13 | 13 | <UserControl.Resources> |
14 | 14 | <cv:NavHighlightConverter x:Key="NavHighlightConverter" /> |
15 | 15 | </UserControl.Resources> |
16 | | - <DockPanel VerticalAlignment="Stretch" HorizontalAlignment="Center" Width="80"> |
| 16 | + <Grid VerticalAlignment="Stretch" HorizontalAlignment="Center" Width="80"> |
| 17 | + <Grid.RowDefinitions> |
| 18 | + <RowDefinition Height="Auto" /> |
| 19 | + <!-- Header --> |
| 20 | + <RowDefinition Height="*" /> |
| 21 | + <!-- Body --> |
| 22 | + <RowDefinition Height="Auto" /> |
| 23 | + <!-- Footer --> |
| 24 | + </Grid.RowDefinitions> |
| 25 | + |
17 | 26 | <!-- Header --> |
18 | | - <StackPanel DockPanel.Dock="Top" Spacing="8" Margin="0,16,0,0" HorizontalAlignment="Center"> |
| 27 | + <StackPanel Grid.Row="0" Margin="0,16,0,0" HorizontalAlignment="Center"> |
19 | 28 | <Image Source="avares://Modulus.App/Assets/avalonia-logo.ico" Width="32" Height="32" Stretch="Uniform"/> |
20 | 29 | <TextBlock Text="Modulus" FontSize="16" FontWeight="Bold" Foreground="#3B82F6" HorizontalAlignment="Center"/> |
21 | 30 | <TextBlock Text="v1.0.0" FontSize="11" Foreground="#888" HorizontalAlignment="Center"/> |
22 | 31 | <!-- Header Items --> |
23 | 32 | <ItemsControl ItemsSource="{Binding HeaderItems}"> |
| 33 | + <ItemsControl.ItemsPanel> |
| 34 | + <ItemsPanelTemplate> |
| 35 | + <StackPanel Spacing="8"/> |
| 36 | + </ItemsPanelTemplate> |
| 37 | + </ItemsControl.ItemsPanel> |
24 | 38 | <ItemsControl.ItemTemplate> |
25 | 39 | <DataTemplate x:DataType="vm:NavigationMenuItemViewModel"> |
26 | 40 | <Button Background="{Binding IsActive, Converter={StaticResource NavHighlightConverter}}" |
|
44 | 58 | </StackPanel> |
45 | 59 |
|
46 | 60 | <!-- Body: Main Menu Items --> |
47 | | - <StackPanel DockPanel.Dock="Top" Spacing="8" Margin="0,32,0,0" HorizontalAlignment="Center"> |
48 | | - <ItemsControl ItemsSource="{Binding BodyItems}"> |
49 | | - <ItemsControl.ItemTemplate> |
50 | | - <DataTemplate x:DataType="vm:NavigationMenuItemViewModel"> |
51 | | - <Button Background="{Binding IsActive, Converter={StaticResource NavHighlightConverter}}" |
52 | | - Foreground="White" |
53 | | - ToolTip.Tip="{Binding Tooltip}" |
54 | | - Width="{Binding Width}" |
55 | | - Height="{Binding Height}" |
56 | | - CornerRadius="{Binding CornerRadius}" |
57 | | - Command="{Binding Command}" |
58 | | - Margin="0,0,0,4"> |
59 | | - <StackPanel> |
60 | | - <TextBlock Text="{Binding Icon}" |
61 | | - FontFamily="Segoe MDL2 Assets" |
62 | | - FontSize="{Binding FontSize}" |
63 | | - HorizontalAlignment="Center"/> |
64 | | - </StackPanel> |
65 | | - </Button> |
66 | | - </DataTemplate> |
67 | | - </ItemsControl.ItemTemplate> |
68 | | - </ItemsControl> |
69 | | - </StackPanel> |
| 61 | + <ItemsControl Grid.Row="1" ItemsSource="{Binding BodyItems}" Margin="0,32,0,0" HorizontalAlignment="Center"> |
| 62 | + <ItemsControl.ItemsPanel> |
| 63 | + <ItemsPanelTemplate> |
| 64 | + <StackPanel Spacing="8"/> |
| 65 | + </ItemsPanelTemplate> |
| 66 | + </ItemsControl.ItemsPanel> |
| 67 | + <ItemsControl.ItemTemplate> |
| 68 | + <DataTemplate x:DataType="vm:NavigationMenuItemViewModel"> |
| 69 | + <Button Background="{Binding IsActive, Converter={StaticResource NavHighlightConverter}}" |
| 70 | + Foreground="White" |
| 71 | + ToolTip.Tip="{Binding Tooltip}" |
| 72 | + Width="{Binding Width}" |
| 73 | + Height="{Binding Height}" |
| 74 | + CornerRadius="{Binding CornerRadius}" |
| 75 | + Command="{Binding Command}" |
| 76 | + Margin="0,0,0,4"> |
| 77 | + <StackPanel> |
| 78 | + <TextBlock Text="{Binding Icon}" |
| 79 | + FontFamily="Segoe MDL2 Assets" |
| 80 | + FontSize="{Binding FontSize}" |
| 81 | + HorizontalAlignment="Center"/> |
| 82 | + </StackPanel> |
| 83 | + </Button> |
| 84 | + </DataTemplate> |
| 85 | + </ItemsControl.ItemTemplate> |
| 86 | + </ItemsControl> |
70 | 87 |
|
71 | 88 | <!-- Footer: Settings/User/Feedback etc. --> |
72 | | - <StackPanel DockPanel.Dock="Bottom" Spacing="8" Margin="0,0,0,24" HorizontalAlignment="Center"> |
73 | | - <ItemsControl ItemsSource="{Binding FooterItems}"> |
74 | | - <ItemsControl.ItemTemplate> |
75 | | - <DataTemplate x:DataType="vm:NavigationMenuItemViewModel"> |
76 | | - <Button Background="{Binding IsActive, Converter={StaticResource NavHighlightConverter}}" |
77 | | - Foreground="White" |
78 | | - ToolTip.Tip="{Binding Tooltip}" |
79 | | - Width="{Binding Width}" |
80 | | - Height="{Binding Height}" |
81 | | - CornerRadius="{Binding CornerRadius}" |
82 | | - Command="{Binding Command}" |
83 | | - Margin="0,0,0,4"> |
84 | | - <StackPanel> |
85 | | - <TextBlock Text="{Binding Icon}" |
86 | | - FontFamily="Segoe MDL2 Assets" |
87 | | - FontSize="{Binding FontSize}" |
88 | | - HorizontalAlignment="Center"/> |
89 | | - </StackPanel> |
90 | | - </Button> |
91 | | - </DataTemplate> |
92 | | - </ItemsControl.ItemTemplate> |
93 | | - </ItemsControl> |
94 | | - </StackPanel> |
95 | | - </DockPanel> |
| 89 | + <ItemsControl Grid.Row="2" ItemsSource="{Binding FooterItems}" Margin="0,0,0,24" HorizontalAlignment="Center"> |
| 90 | + <ItemsControl.ItemsPanel> |
| 91 | + <ItemsPanelTemplate> |
| 92 | + <StackPanel Spacing="8"/> |
| 93 | + </ItemsPanelTemplate> |
| 94 | + </ItemsControl.ItemsPanel> |
| 95 | + <ItemsControl.ItemTemplate> |
| 96 | + <DataTemplate x:DataType="vm:NavigationMenuItemViewModel"> |
| 97 | + <Button Background="{Binding IsActive, Converter={StaticResource NavHighlightConverter}}" |
| 98 | + Foreground="White" |
| 99 | + ToolTip.Tip="{Binding Tooltip}" |
| 100 | + Width="{Binding Width}" |
| 101 | + Height="{Binding Height}" |
| 102 | + CornerRadius="{Binding CornerRadius}" |
| 103 | + Command="{Binding Command}" |
| 104 | + Margin="0,0,0,4"> |
| 105 | + <StackPanel> |
| 106 | + <TextBlock Text="{Binding Icon}" |
| 107 | + FontFamily="Segoe MDL2 Assets" |
| 108 | + FontSize="{Binding FontSize}" |
| 109 | + HorizontalAlignment="Center"/> |
| 110 | + </StackPanel> |
| 111 | + </Button> |
| 112 | + </DataTemplate> |
| 113 | + </ItemsControl.ItemTemplate> |
| 114 | + </ItemsControl> |
| 115 | + </Grid> |
96 | 116 | </UserControl> |
0 commit comments