Skip to content

Commit

Permalink
Merge pull request #9 from RolandKoenig/8-mainwindowframe-should-prov…
Browse files Browse the repository at this point in the history
…ide-an-area-for-the-background-of-the-whole-window

Added FullBackgroundArea to MainWindowFrame
  • Loading branch information
RolandKoenig authored Dec 30, 2023
2 parents da91453 + 89b4704 commit 3033d40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/RolandK.AvaloniaExtensions/Themes/Fluent.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Color="{DynamicResource SystemBaseMediumLowColor}" />

<!-- MainWindowFrame -->
<SolidColorBrush x:Key="MainWindowFrameBackgroundBrush"
<SolidColorBrush x:Key="MainWindowFrameTitleBackgroundBrush"
Color="{DynamicResource SystemAltHighColor}" />

</Styles.Resources>
Expand Down
8 changes: 7 additions & 1 deletion src/RolandK.AvaloniaExtensions/Views/MainWindowFrame.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<!-- Full background -->
<Panel x:Name="CtrlFullBackgroundPanel"
Grid.Row="0"
Grid.RowSpan="2"
IsHitTestVisible="False"/>

<!-- Title row -->
<Grid Grid.Row="0"
Background="{DynamicResource MainWindowFrameBackgroundBrush}"
Background="{DynamicResource MainWindowFrameTitleBackgroundBrush}"
IsHitTestVisible="False">
<StackPanel x:Name="CtrlCustomTitleArea"
Orientation="Horizontal" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Controls;
Expand All @@ -19,13 +18,16 @@ public partial class MainWindowFrame : MvvmUserControl

private Window? _mainWindow;
private Grid _ctrlFullWindowGrid;
private Panel _ctrlFullBackgroundPanel;
private Grid _ctrlMainGrid;
private StackPanel _ctrlCustomTitleArea;
private Panel _ctrlHeaderMenuArea;
private Panel _ctrlMainContentArea;
private Panel _ctrlFooterArea;
private Panel _ctrlStatusBar;

public Controls FullBackgroundArea => _ctrlFullBackgroundPanel.Children;

public Controls CustomTitleArea => _ctrlCustomTitleArea.Children;

public Controls HeaderMenuArea => _ctrlHeaderMenuArea.Children;
Expand All @@ -49,6 +51,7 @@ public MainWindowFrame()
AvaloniaXamlLoader.Load(this);

_ctrlFullWindowGrid = this.Find<Grid>("CtrlFullWindowGrid") ?? throw new InvalidOperationException("Control CtrlFullWindowGrid not found!");
_ctrlFullBackgroundPanel = this.Find<Panel>("CtrlFullBackgroundPanel") ?? throw new InvalidOperationException("Control CtrlFullBackgroundPanel not found!");
_ctrlMainGrid = this.Find<Grid>("CtrlMainGrid")?? throw new InvalidOperationException("Control CtrlMainGrid not found!");
_ctrlCustomTitleArea = this.Find<StackPanel>("CtrlCustomTitleArea") ?? throw new InvalidOperationException("Control CtrlCustomTitleArea not found!");
_ctrlHeaderMenuArea = this.Find<Panel>("CtrlHeaderMenuArea") ?? throw new InvalidOperationException("Control CtrlHeaderMenuArea not found!");
Expand Down

0 comments on commit 3033d40

Please sign in to comment.