Skip to content

Commit bd041f2

Browse files
authored
add style overrides for other page types (#20985)
1 parent d323efb commit bd041f2

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/Avalonia.Controls/Page/CarouselPage.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
using System;
12
using System.Collections;
23
using System.Collections.Generic;
3-
using System.Linq;
44
using Avalonia.Animation;
55
using Avalonia.Automation;
66
using Avalonia.Automation.Peers;
@@ -11,7 +11,6 @@
1111
using Avalonia.Controls.Templates;
1212
using Avalonia.Input;
1313
using Avalonia.Interactivity;
14-
using Avalonia.Media;
1514
using Avalonia.Threading;
1615

1716
namespace Avalonia.Controls
@@ -111,6 +110,8 @@ public bool IsKeyboardNavigationEnabled
111110
set => SetValue(IsKeyboardNavigationEnabledProperty, value);
112111
}
113112

113+
protected override Type StyleKeyOverride => typeof(CarouselPage);
114+
114115
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
115116
{
116117
base.OnApplyTemplate(e);

src/Avalonia.Controls/Page/DrawerPage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,8 @@ public SplitViewDisplayMode DisplayMode
535535
set => SetValue(DisplayModeProperty, value);
536536
}
537537

538+
protected override Type StyleKeyOverride => typeof(DrawerPage);
539+
538540
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
539541
{
540542
base.OnApplyTemplate(e);

src/Avalonia.Controls/Page/NavigationPage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
using System;
2-
using System.Collections;
32
using System.Collections.Generic;
43
using System.Threading;
54
using System.Threading.Tasks;
65
using Avalonia.Animation;
76
using Avalonia.Automation;
87
using Avalonia.Automation.Peers;
98
using Avalonia.Controls.Metadata;
10-
using Avalonia.Logging;
11-
using Avalonia.LogicalTree;
129
using Avalonia.Controls.Presenters;
1310
using Avalonia.Controls.Primitives;
14-
using Avalonia.Controls.Shapes;
1511
using Avalonia.Input;
1612
using Avalonia.Input.GestureRecognizers;
1713
using Avalonia.Interactivity;
14+
using Avalonia.Logging;
15+
using Avalonia.LogicalTree;
1816
using Avalonia.Media;
1917
using Avalonia.Metadata;
2018
using Avalonia.Reactive;
@@ -619,6 +617,8 @@ private Button? BackButton
619617
}
620618
}
621619

620+
protected override Type StyleKeyOverride => typeof(NavigationPage);
621+
622622
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
623623
{
624624
if (change.Property == PagesProperty &&

src/Avalonia.Controls/Page/TabbedPage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Avalonia.Controls.Templates;
1010
using Avalonia.Input;
1111
using Avalonia.Input.GestureRecognizers;
12-
using Avalonia.LogicalTree;
1312
using Avalonia.Threading;
1413

1514
namespace Avalonia.Controls
@@ -150,6 +149,8 @@ public IDataTemplate? IndicatorTemplate
150149
set => SetValue(IndicatorTemplateProperty, value);
151150
}
152151

152+
protected override Type StyleKeyOverride => typeof(TabbedPage);
153+
153154
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
154155
{
155156
base.OnAttachedToVisualTree(e);

0 commit comments

Comments
 (0)