mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 13:57:28 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -8,35 +8,35 @@ using Xamarin.Forms.Xaml;
|
|||
|
||||
namespace TINK.View.Root
|
||||
{
|
||||
/// <summary>
|
||||
/// Mamages creation of detail pages if a flyout page menu entry is selected.
|
||||
/// Exposes flyout page style navigation which is used by detail pages.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Examples of use cases when detail pages do navigation:
|
||||
// - switch to map page after succesfully logging in/ logging out
|
||||
// - switch to login page form bikes at station page if not yet logged in
|
||||
/// </remarks>
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
/// <summary>
|
||||
/// Mamages creation of detail pages if a flyout page menu entry is selected.
|
||||
/// Exposes flyout page style navigation which is used by detail pages.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Examples of use cases when detail pages do navigation:
|
||||
// - switch to map page after succesfully logging in/ logging out
|
||||
// - switch to login page form bikes at station page if not yet logged in
|
||||
/// </remarks>
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
#if USEFLYOUT
|
||||
public partial class RootPage : FlyoutPage, INavigationMasterDetail
|
||||
#else
|
||||
public partial class RootPage : FlyoutPage
|
||||
public partial class RootPage : FlyoutPage
|
||||
#endif
|
||||
{
|
||||
public RootPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
||||
{
|
||||
public RootPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
|
||||
|
||||
// Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
||||
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
||||
// Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
|
||||
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
|
||||
|
||||
var navigationPage = Detail as NavigationPage;
|
||||
if (navigationPage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var navigationPage = Detail as NavigationPage;
|
||||
if (navigationPage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#if USEFLYOUT
|
||||
var detailPage = navigationPage.RootPage as IDetailPage;
|
||||
|
@ -47,38 +47,38 @@ namespace TINK.View.Root
|
|||
|
||||
detailPage.NavigationMasterDetail = this;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is called if a flyout page menu entry is selected.
|
||||
/// Creates a new page.
|
||||
/// </summary>
|
||||
private void OnListViewItemSelected(object sender, SelectedItemChangedEventArgs e)
|
||||
{
|
||||
if (!(e.SelectedItem is RootPageFlyoutMenuItem item))
|
||||
{
|
||||
// Unexpected argument detected.
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// Is called if a flyout page menu entry is selected.
|
||||
/// Creates a new page.
|
||||
/// </summary>
|
||||
private void OnListViewItemSelected(object sender, SelectedItemChangedEventArgs e)
|
||||
{
|
||||
if (!(e.SelectedItem is RootPageFlyoutMenuItem item))
|
||||
{
|
||||
// Unexpected argument detected.
|
||||
return;
|
||||
}
|
||||
|
||||
// Set selected station to new
|
||||
App.ModelRoot.SelectedStation = new NullStation();
|
||||
// Set selected station to new
|
||||
App.ModelRoot.SelectedStation = new NullStation();
|
||||
|
||||
ShowPage(item.TargetType, item.Title);
|
||||
ShowPage(item.TargetType, item.Title);
|
||||
|
||||
IsPresented = false;
|
||||
FlyoutPage.ListView.SelectedItem = null;
|
||||
}
|
||||
IsPresented = false;
|
||||
FlyoutPage.ListView.SelectedItem = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows a detail page.
|
||||
/// </summary>
|
||||
/// <param name="typeOfPage">Type of page to show.</param>
|
||||
/// <param name="title">Title of page.</param>
|
||||
public void ShowPage(Type typeOfPage, string title)
|
||||
{
|
||||
var page = (Page)Activator.CreateInstance(typeOfPage);
|
||||
page.Title = title;
|
||||
/// <summary>
|
||||
/// Shows a detail page.
|
||||
/// </summary>
|
||||
/// <param name="typeOfPage">Type of page to show.</param>
|
||||
/// <param name="title">Title of page.</param>
|
||||
public void ShowPage(Type typeOfPage, string title)
|
||||
{
|
||||
var page = (Page)Activator.CreateInstance(typeOfPage);
|
||||
page.Title = title;
|
||||
|
||||
#if USEFLYOUT
|
||||
if (page is IDetailPage detailPage)
|
||||
|
@ -89,7 +89,7 @@ namespace TINK.View.Root
|
|||
}
|
||||
#endif
|
||||
|
||||
Detail = new NavigationPage(page);
|
||||
}
|
||||
}
|
||||
Detail = new NavigationPage(page);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,19 +18,19 @@ using Xamarin.Forms.Xaml;
|
|||
|
||||
namespace TINK.View.Root
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class RootPageFlyout : ContentPage
|
||||
{
|
||||
public ListView ListView;
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class RootPageFlyout : ContentPage
|
||||
{
|
||||
public ListView ListView;
|
||||
|
||||
public RootPageFlyout()
|
||||
{
|
||||
InitializeComponent();
|
||||
public RootPageFlyout()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = new RootPageFlyoutViewModel();
|
||||
BindingContext = new RootPageFlyoutViewModel();
|
||||
|
||||
ListView = MenuItemsListView;
|
||||
}
|
||||
ListView = MenuItemsListView;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,18 +3,18 @@
|
|||
namespace TINK.View.Root
|
||||
{
|
||||
|
||||
public class RootPageFlyoutMenuItem
|
||||
{
|
||||
public RootPageFlyoutMenuItem()
|
||||
{
|
||||
TargetType = typeof(RootPageFlyoutMenuItem);
|
||||
}
|
||||
public int Id { get; set; }
|
||||
public class RootPageFlyoutMenuItem
|
||||
{
|
||||
public RootPageFlyoutMenuItem()
|
||||
{
|
||||
TargetType = typeof(RootPageFlyoutMenuItem);
|
||||
}
|
||||
public int Id { get; set; }
|
||||
|
||||
public string GlyphCode { get; set; }
|
||||
public string GlyphCode { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
public Type TargetType { get; set; }
|
||||
}
|
||||
public Type TargetType { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue