Xamarin Forms shell Navigation - different page content for logged user - xamarin

So, I'm making app in Xamarin Forms, and I'd like to have different content of page if user is logged.
I was already trying to achive this with pushModalAsync but result page do not have Flyout menu witch is important to me.
One solution that comes to my mind is to put two different content i want to show in frame and bind this frame`s IsVisible property to IsLogged. Is it better way to do this?

Related

Ionic 4 popover and/or actionsheet on PWA?

I'm building an Ionic 4 PWA and I am looking for a "simple" solution to the following:
For each item in a list e.g. a newsfeed or comments list: I want a "more" icon (the dotdotdot icon) to show a list of options the logged in user has available e.g. if they own the comment or newsfeed item they will have extra options like "edit" and "delete" etc.
Now I can use an ActionSheet to show these options and dynamically add the correct options into the sheet - all well and good. But this only looks good on a mobile device. If the user is on a desktop then an action sheet looks out of place. So, a Popover would look better but only on the desktop view.
Is it possible to dynamically create a popover in code without having to create a component for it as the items in the popover list will vary depending on what type of object it is e.g. newsfeed, comment etc and their access rights to that object e.g. edit/delete etc.
Not sure if I have explained this very well but looking for a slick, simple UI Ionic 4 way of displaying "options" to the user when then click/tap on the more icon depending on device.
I did go down the route of having ActionSheet for mobile users and Material Design Mat-Menu for the desktop but it just seems over complicated.
Any advice would help.
Thanks,
Rowie
How about a popover with a custom css class that is using a screen media query?

Is it possible to change a web site inside a Xamarin web view?

We want to open a web site inside a Xamarin web view but we want to hide some parts of it.
Is it possible to manipulate the web site's DOM to for example, hide a banner, or a button?
Also, we want to hide those things before they even appear so the user don't see them disappearing.
Thanks

How to allow Xamarin Forms TabbedPage to control the tabMode in Tabbar.axml for Android

I want to have different TabbedPages within my app with different tabModes.
IE:
TabbedPageOne with app:tabMode="scrollable"
TabbedPageTwo with app:tabMode="fixed"
This is currently possible? If not, how can it be achieved?
The setting can be easily changed app wide (How to make Tabbed page of many content page with a scroll menu in Xamarin forms?), but want it to be configurable per TabbedPage.

Custom Navigation with Xamarin.Forms

I’m working on an application for Android and iOS, which requires a certain flexibility for one or two views. That’s why we created & implemented a service that translated a basic list of objects into a user interface for both iOS & Android. But now that Xamarin.Forms is released, we decided to replace our service by the one Xamarin provides. I did succeed in creating the views with Xamarin.Forms, resulting in better looking & smoother running pages. But my problem lies in the navigation of it. Here is a little drawing on what I would like to achieve:
I would like my app to start an activity that starts with a custom fragment. After clicking a button on this fragment, I would like the page I created with the Xamarin.Forms api to be added to my current navigation stack! Once the user is finished with the Xamarin.Forms page, it navigates to a second custom fragment, all that without breaking the navigation cycle. Does anybody have an idea on how I can achieve this?
For the iOS developpers: replace Activity with NavigationController & Fragment with ViewController
Take a look at CarouselPage for Xamarin.Forms' own approach. It doesn't look like that's what you need but you can also look at its source code and maybe make a custom renderer yourself.
You may also want to take a look at MVVM
As for the easier/hackier way you'd want to make a button on each page and when the button is tapped execute Navigation.PushModalAsync(nextPage) - there won't be a "< Back" button any more, you may need to implement that yourself if you need it.
If by your meaning of 'current navigation stack' is for using the native Navigation of each platform, then remember that you don't have to use Xamarin.Forms' Navigation Model and functions such like PushAsync.
If you prefer to do Navigation with code specific to each platform then you can do this the same as normal. Just create your stub pages in each platform specific project and set the Xamarin.Forms content for each page from the shared project.
From each platform specific stub page (Activity / UIView / PhoneApplicationPage) you could then execute an Action<> call setting on the shared Xamarin.Forms page to help with the navigation, or alternatively, hook into a custom-event that is raised from the Xamarin.Forms** page back to the platform specific stub page to allow you to do navigation from there.
Like Sten mentioned there won't be any 'Back' button so you will most likely have to do that yourself.

Windows Phone Application - Start page depends on FileExist in isolated storage

I'm developing application that start page depends on file existing in isolated storage.
If file doesn't exist my application shows some form to setup configuration, but if it exist I wish this page will not be diesplayed.
For now I just load configutarion page but if file exist i use NavigationService to navigate to proper page on pageloaded event. The problem is that after I play with my app and hit back button it goes to configuration setup and because file exist it navigates me stright to my app again. I despite the fact that setup screen blinks on the application launching.
So my question is - how to setup startup page depends on some condition ?
The advice that I've heard is to use a UserControl on your startup page - then toggle the visibility depending on the condition you have. That way you don't end up with an unwanted page in the backstack and you get to fully control the UX.
The example I heard it with was a login page - not something you want on the backstack usually - but something you can easily check a bool to hide/show the user control.
The place I heard it was this video from Mix 11: Expert Lessons: Top Tips for Building a Successful Windows Phone Application. You can download the code to the demo (it is the first demo in that video) from the bottom of his blog entry here (which gives some more detail): Demos from my Mix 2011 session - Part 1: Navigation Tips
There is no way to launch different page on some conditions.
There are methods to manipulate Page Stack in NavigationService class, so you can remove setup page from history and app not will be navigated to it when user tap back button.
For fighting with page blinking you can put an image (the same image as splashscreen) above your page, and hide it when right content loaded

Resources