-
-
Notifications
You must be signed in to change notification settings - Fork 966
Expand file tree
/
Copy pathINavigationView.cs
More file actions
267 lines (216 loc) · 9.2 KB
/
INavigationView.cs
File metadata and controls
267 lines (216 loc) · 9.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
/* Based on Windows UI Library
Copyright(c) Microsoft Corporation.All rights reserved. */
using System.Collections;
using System.Windows.Controls;
using Wpf.Ui.Abstractions;
using Wpf.Ui.Animations;
// ReSharper disable once CheckNamespace
namespace Wpf.Ui.Controls;
/// <summary>
/// Represents a container that enables navigation of app content. It has a header, a view for the main content, and a menu pane for navigation commands.
/// </summary>
public interface INavigationView
{
/// <summary>
/// Gets or sets the header content.
/// </summary>
object? Header { get; set; }
/// <summary>
/// Gets or sets the <see cref="Header"/> visibility.
/// </summary>
Visibility HeaderVisibility { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the header is always visible.
/// </summary>
bool AlwaysShowHeader { get; set; }
/// <summary>
/// Gets the collection of menu items displayed in the NavigationView.
/// </summary>
IList MenuItems { get; }
/// <summary>
/// Gets or sets an object source used to generate the content of the NavigationView menu.
/// </summary>
object? MenuItemsSource { get; set; }
/// <summary>
/// Gets the list of objects to be used as navigation items in the footer menu.
/// </summary>
IList FooterMenuItems { get; }
/// <summary>
/// Gets or sets the object that represents the navigation items to be used in the footer menu.
/// </summary>
object? FooterMenuItemsSource { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the top separators is visible.
/// </summary>
bool IsTopSeparatorVisible { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the footer separators is visible.
/// </summary>
bool IsFooterSeparatorVisible { get; set; }
/// <summary>
/// Gets the selected item.
/// </summary>
INavigationViewItem? SelectedItem { get; }
/// <summary>
/// Gets or sets a UI element that is shown at the top of the control, below the pane if PaneDisplayMode is Top.
/// </summary>
object? ContentOverlay { get; set; }
/// <summary>
/// Gets a value indicating whether the back button is enabled or disabled.
/// </summary>
bool IsBackEnabled { get; }
/// <summary>
/// Gets or sets a value that indicates whether the back button is visible or not.
/// Default value is "Auto", which indicates that button visibility depends on the DisplayMode setting of the NavigationView.
/// </summary>
NavigationViewBackButtonVisible IsBackButtonVisible { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the toggle button is visible.
/// </summary>
bool IsPaneToggleVisible { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the NavigationView pane is expanded to its full width.
/// </summary>
bool IsPaneOpen { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the pane is shown.
/// </summary>
bool IsPaneVisible { get; set; }
/// <summary>
/// Gets or sets the width of the NavigationView pane when it's fully expanded.
/// </summary>
double OpenPaneLength { get; set; }
/// <summary>
/// Gets or sets the width of the NavigationView pane in its compact display mode.
/// </summary>
double CompactPaneLength { get; set; }
/// <summary>
/// Gets or sets the content for the pane header.
/// </summary>
object? PaneHeader { get; set; }
/// <summary>
/// Gets or sets the label adjacent to the menu icon when the NavigationView pane is open.
/// </summary>
string? PaneTitle { get; set; }
/// <summary>
/// Gets or sets the content for the pane footer.
/// </summary>
object? PaneFooter { get; set; }
/// <summary>
/// Gets or sets a value that specifies how the pane and content areas of a NavigationView are being shown.
/// <para>It is not the same PaneDisplayMode as in WinUi.</para>
/// </summary>
NavigationViewPaneDisplayMode PaneDisplayMode { get; set; }
/// <summary>
/// Gets or sets an TitleBar to be displayed in the NavigationView.
/// </summary>
TitleBar? TitleBar { get; set; }
/// <summary>
/// Gets or sets an AutoSuggestBox to be displayed in the NavigationView.
/// </summary>
AutoSuggestBox? AutoSuggestBox { get; set; }
/// <summary>
/// Gets or sets an BreadcrumbBar that is in <see cref="Header"/>.
/// </summary>
BreadcrumbBar? BreadcrumbBar { get; set; }
/// <summary>
/// Gets or sets the template property for <see cref="MenuItems"/> and <see cref="FooterMenuItems"/>.
/// </summary>
ControlTemplate? ItemTemplate { get; set; }
/// <summary>
/// Gets or sets a value deciding how long the effect of the transition between the pages should take.
/// </summary>
int TransitionDuration { get; set; }
/// <summary>
/// Gets or sets type of <see cref="INavigationView"/> transitions during navigation.
/// </summary>
Transition Transition { get; set; }
/// <summary>
/// Gets or sets margin for a Frame of <see cref="INavigationView"/>
/// </summary>
Thickness FrameMargin { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the GridSplitter is enabled in the LeftNavigationViewTemplate.
/// </summary>
bool IsGridSplitterEnabled { get; set; }
/// <summary>
/// Occurs when the NavigationView pane is opened.
/// </summary>
event TypedEventHandler<NavigationView, RoutedEventArgs> PaneOpened;
/// <summary>
/// Occurs when the NavigationView pane is closed.
/// </summary>
event TypedEventHandler<NavigationView, RoutedEventArgs> PaneClosed;
/// <summary>
/// Occurs when the currently selected item changes.
/// </summary>
event TypedEventHandler<NavigationView, RoutedEventArgs> SelectionChanged;
/// <summary>
/// Occurs when an item in the menu receives an interaction such as a click or tap.
/// </summary>
event TypedEventHandler<NavigationView, RoutedEventArgs> ItemInvoked;
/// <summary>
/// Occurs when the back button receives an interaction such as a click or tap.
/// </summary>
event TypedEventHandler<NavigationView, RoutedEventArgs> BackRequested;
/// <summary>
/// Occurs when a new navigation is requested
/// </summary>
event TypedEventHandler<NavigationView, NavigatingCancelEventArgs> Navigating;
/// <summary>
/// Occurs when navigated to page
/// </summary>
event TypedEventHandler<NavigationView, NavigatedEventArgs> Navigated;
/// <summary>
/// Gets a value indicating whether there is at least one entry in back navigation history.
/// </summary>
bool CanGoBack { get; }
/// <summary>
/// Synchronously navigates current navigation Frame to the
/// given Element.
/// </summary>
bool Navigate(Type pageType, object? dataContext = null);
/// <summary>
/// Synchronously navigates current navigation Frame to the
/// given Element.
/// </summary>
bool Navigate(string pageIdOrTargetTag, object? dataContext = null);
/// <summary>
/// Synchronously adds an element to the navigation stack and navigates current navigation Frame to the
/// </summary>
bool NavigateWithHierarchy(Type pageType, object? dataContext = null);
/// <summary>
/// Replaces the contents of the navigation frame, without changing the currently selected item or triggering an <see cref="SelectionChanged"/>.
/// </summary>
bool ReplaceContent(Type pageTypeToEmbed);
/// <summary>
/// Replaces the contents of the navigation frame, without changing the currently selected item or triggering an <see cref="SelectionChanged"/>.
/// </summary>
bool ReplaceContent(UIElement pageInstanceToEmbed, object? dataContext = null);
/// <summary>
/// Navigates the NavigationView to the next journal entry.
/// </summary>
/// <returns><see langword="true"/> if successfully navigated forward, otherwise <see langword="false"/>.</returns>
bool GoForward();
/// <summary>
/// Navigates the NavigationView to the previous journal entry.
/// </summary>
/// <returns><see langword="true"/> if successfully navigated backward, otherwise <see langword="false"/>.</returns>
bool GoBack();
/// <summary>
/// Clears the NavigationView history.
/// </summary>
void ClearJournal();
/// <summary>
/// Allows you to assign to the NavigationView a special service responsible for retrieving the page instances.
/// </summary>
void SetPageProviderService(INavigationViewPageProvider navigationViewPageProvider);
/// <summary>
/// Allows you to assign a general <see cref="IServiceProvider"/> to the NavigationView that will be used to retrieve page instances and view models.
/// </summary>
void SetServiceProvider(IServiceProvider serviceProvider);
}