This commit is contained in:
parent
0591941373
commit
adf4cfa8df
@ -34,7 +34,16 @@ public struct NavigationView<Item>: WinUIWidget where Item: NavigationViewItem {
|
|||||||
/// The currently selected item.
|
/// The currently selected item.
|
||||||
var selectedItem: Selection {
|
var selectedItem: Selection {
|
||||||
get {
|
get {
|
||||||
if let last = path.last {
|
if let last = path.last(
|
||||||
|
where: { item in
|
||||||
|
switch item {
|
||||||
|
case .settings:
|
||||||
|
return settings
|
||||||
|
case let .custom(item):
|
||||||
|
return items.contains(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) {
|
||||||
last
|
last
|
||||||
} else if let first = items.first {
|
} else if let first = items.first {
|
||||||
.custom(item: first)
|
.custom(item: first)
|
||||||
|
Loading…
Reference in New Issue
Block a user