Skip to content

Commit bd56318

Browse files
2 parents 83cc012 + 6cec2cd commit bd56318

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,5 @@ MigrationBackup/
360360
.ionide/
361361

362362
# Fody - auto-generated XML schema
363-
FodyWeavers.xsd
363+
FodyWeavers.xsd
364+
.DS_Store

samples/Views/Playlist.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public override View GetView() =>
4343

4444
_ = scrollView.ScrollToAsync(0, 0, false);
4545

46-
if (DeviceInfo.Platform == DevicePlatform.WinUI) return;
46+
if (DeviceInfo.Idiom == DeviceIdiom.Desktop) return;
4747
StatusBar.SetColor(user.BackgroundColor);
4848
StatusBar.SetStyle(StatusBarStyle.LightContent);
4949
});

samples/Views/PlaylistCollection.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ public override View GetView() =>
2828
}
2929
.ItemsSource(dal.Users)
3030
.ItemTemplate(
31+
// not working properly on mac
32+
// https://github.com/dotnet/maui/issues/19329
3133
TransitionView.Build<PlaylistCollection, Playlist, PlaylistTransitionView>(item =>
3234
{
3335
var user = (PlaylistVM)item; // <- the item source
3436
return $"id={user.Id}"; // <- the route params
3537
}))
3638
.OnEntering(this, v =>
3739
{
38-
if (DeviceInfo.Platform == DevicePlatform.WinUI) return;
40+
if (DeviceInfo.Idiom == DeviceIdiom.Desktop) return;
3941
StatusBar.SetColor(Colors.White);
4042
StatusBar.SetStyle(StatusBarStyle.DarkContent);
4143
});

samples/Views/PlaylistTransitionView.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public PlaylistTransitionView()
105105
.Add(Button.TextColorProperty, Colors.Black)
106106
.Add(Button.FontSizeProperty, 18)
107107
.Add(Button.FontFamilyProperty, "Icons")
108-
.Add(Button.CornerRadiusProperty, 100)
109108
.Add(Button.PaddingProperty, new Thickness(0));
110109

111110
private void InitializeContent()
@@ -304,5 +303,11 @@ private void InitializeContent()
304303
.Bind(
305304
BackgroundColorProperty,
306305
getter: (PlaylistVM vm) => vm.BackgroundColor);
306+
307+
#if MACCATALYST || IOS
308+
// BUG, the Tapped is not working on MacCatalyst
309+
_backButton.Clicked += (s, e) => FlowNavigation.Current.GoBack();
310+
#endif
311+
307312
}
308313
}

src/FlowExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public static T OnTapped<T>(this T view, Action<Point> action) where T : Content
7373

7474
tapGesture.Tapped += (s, e) =>
7575
{
76+
// not working properly on mac
77+
// https://github.com/dotnet/maui/issues/19329
78+
7679
var p = e.GetPosition(FlowNavigation.Current.View.Presenter);
7780
var p0 = e.GetPosition(view.Content);
7881

src/TransitionView.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static DataTemplate Build<TFromView, TToView, TTransitionView>(
4646
{
4747
var transitionView = new TTransitionView();
4848

49-
_ = transitionView
49+
_ = transitionView.Content
5050
.OnTapped(p =>
5151
{
5252
var tv = FlowNavigation.Current.GetView<TToView>().TransitionView;
@@ -61,10 +61,9 @@ public static DataTemplate Build<TFromView, TToView, TTransitionView>(
6161
}
6262

6363
_ = FlowNavigation.Current.GoTo<TToView>(routeParamsBuilder?.Invoke(transitionView.BindingContext));
64-
})
65-
.Complete(typeof(TFromView));
64+
});
6665

67-
transitionView.OnBreakpointChanged();
66+
transitionView.Complete(typeof(TFromView)).OnBreakpointChanged();
6867

6968
return transitionView;
7069
});

0 commit comments

Comments
 (0)