24.12.2020

How To Use Custom Navigation Bar App With Mac

How To Use Custom Navigation Bar App With Mac Rating: 6,0/10 2457 votes

We’re excited to announce the release of new app navigation experiences that give reporting teams the power to customize navigation for end users, so they can find content quickly and understand the relationships between different reports and dashboards. We’ve also sprinkled in several important new features to help app authors create supportable apps that delight their users.

We’ve started rolling out the new app creation experiences and expect it to reach commercial cloud customers by 5/25/2019.

Notes app has vastly improved with the introduction of iOS 11 and macOS High Sierra. It has got some highly functional features including the option to insert tablet to a note on iPhone/iPad and Mac. The process of adding a table in the Notes app on iOS 11 and macOS High is quite straightforward.

  • Custom Icons (iOS 12 and Earlier) In iOS 13 or later, prefer using SF Symbols to represent tasks and modes in your app. If your app is running in iOS 12 or earlier, or if you need to create custom bitmap icons, follow the guidance below. Create recognizable, highly-simplified designs. Too many details can make an icon confusing or unreadable.
  • Finally, we will be able to paint using the canvas object which is the component on which we will paint. Canvas offers several drawing methods and the one that suits our use case is canvas.drawPath(Path path, Paint paint) that according to the documentation draws the specified path using the specified paint and the path will be filled or framed based on the Style in the paint.
  • To add a navigation bar to your interface, the following steps are required: Set up Auto Layout rules to govern the position of the navigation bar in your interface. Create a root navigation item to supply the initial title. Configure a delegate object to handle user interactions with the navigation bar.

Here’s what a finished app will look like. In this blog post we’ll describe how you create and use this app.

New Setup Experiences

When you create or update an app, you will immediately notice some UI changes. The Setup tab has an updated look and some subtle but important changes.

You can now customize the name of your app, so it’s not identical to the workspaces it comes from. You can also change the icon to be app specific. We added more App theme color choices so you have newer and more diverse colors to choose from.

Lastly, we added the option to provide a support URL. You can set it to a SharePoint page or another resource where your app users can go to learn about your app or to get help when using it. This is important since it is easier to support app users at scale, which is commonly 1000s of users.

New Navigation Builder

The new navigation builder is where most of the new capabilities are provided. When you turn on the app nav, at first you’ll see a flat list of all the interactive and paginated reports, dashboards, and workbooks you’ve added to your app.

The Navigation builder pane lets you do all sorts of customization including reordering the items, hiding items, grouping related items into sections, or even adding links to other content that app users should be able to access. When you select an item in the Navigation builder you will see a details card for it where you can further customize by renaming the item. Together these capabilities allow you to produce a very customized experience such as the one below.

You can add Sections and Links to the Navigation using the New button.

Sections let you group related items together for an organized look and feel. These will get added to the end of the navigation. Each comes with a details card where you can name a section or move items up and down in the Navigation builder until they’re in the desired section. Sections can be expanded or collapsed while editing the navigation, but also by end users when they’re using the app.

Links in the Navigation is deceivingly simple and quite powerful. It allows you to link to other content related to your app but that’s not in the app itself. For example, you might link to a line of business system like Dynamics CRM to help users close on opportunities, or even a related Power BI app.

It’s even more powerful though since you can also select where the Link opens. The Content area option allows embedding directly within the app where you’d normally see a report or dashboard. For example, a video explaining how to use the app, or an internal web page. Just make sure the link you add supports embedding, since some services block this. Also make sure all the app users have permission to see the content in the links, since Power BI app publishing doesn’t manage that.

The Link feature with the ability to Open in the Content Area is extremely useful for organizations that still have some of their analytics in on premise services. If, like Power BI Report Server, your on premises service supports embedding, you can integrate that existing content within you new Power BI apps. This lets you distribute one URL and users can quickly access all the data they need to do their jobs. This gives you great flexibility as you plan your journey from on premises to the cloud, including hybrid options. Note that this feature is not intended for use with content in the Power BI Service.

Experience for app consumers

Once you’ve published or updated your app, end users will see it something like the below.

The user sees the custom navigation you defined, and Power BI gets out of the way hiding the overall Power BI navigation. All the sections are collapsed by default to make apps with many items less intimidating to end users. When a user views a report, the pages are shown in the left navigation. This makes it seamless and easy for app users to navigate through all app content.

Any Links set to Open In Content Area are shown within the app itself, so users never have to leave the app to get their jobs done. Below we can see a video embedded in the app.

The new app information pane clearly displays the app metadata including the support site you specified. The new info icon on the actions bar opens the pane. This makes it easier for IT teams to support their apps at scale. Commonly apps are deployed to 1000 or 10’s of 1000 of users, so this really helps.

To further customize the app, you can work with the report and dashboard authors to adopt a color scheme that matches your app navigation color. The example at the top of the blog post shows how integrated and seamless this can look and feel for your users. In the end you can produce stunning apps that look like a professional web developer created them which is sure to impress your colleagues and help drive a data culture within your organization.

Existing applications

These new features do not change how existing applications work by default. The app author needs to opt-in to use the new navigation builder for an existing app. New apps you create for the first time will default to use the new navigation build. However, the app author can choose to turn it off. This allows you to create traditional apps where users see a list of content or an item you choose when they open the app.

Licensing

The new navigation builder and support features are available for all apps, so they do not require Power BI Premium.

Next steps

Intro:

I think I've started countless apps and said to myself, hey you really need to sit down and take the time to explain to yourself how exactly these Xamarin Forms custom header bars are actually working to get an understanding on how to maintain existing ones and to be able to develop better ones in the future. So here goes, my explanation of how to build a Xamarin Forms custom header/navigation bar with back button that'll work on any device past and present.

The code:

First things first. In a typical Xamarin Forms project, you'll have an App.cs in the shared/portable project, this is great but we need a .xaml file to go with it, so right click the project, click 'Add' and then click 'New Item...' When the window opens, choose 'Forms Xaml Page' then name it App.xaml and click 'Add'. This'll add the xaml file to your project, but there's already an issue. Yay! Visual Studio has created another cs file for this page called App.xaml.cs, we don't want this as it'll conflict with our existing file so delete the cs file and we're ready to make some changes to the xaml file. Open the xaml file and delete everything in it, then paste in the following code. I'll explain what it does once you've done it. ;)

As you can see above, App.xaml is a sort of hybrid between an app configuration and a layout template, it allows you to define a set of application resources and within that, a set of control templates, these templates are what we need to set up our custom header/navigation bar because once you define a ControlTempate with a key, you're then free to write the layout code for that template directly within the control template. You might wonder why I use an Image and then assign a GestureRecognizer instead of just having an image button... Well my method has a little more code but will allow you to rezise images that you assign unlike the image button which will just crop the image if it's too large.

Before we move on, I'll save you the trouble of the 'Application.Resources StaticResource not found for key' error which you would later run into if you do not follow the next step.

Open the original App.cs file and within the constructor for that class, before everything else, add 'InitializeComponent();' as when we get round to testing, this will solve the error I've spoken about above which will save you a bit of head scratching.

Thinking back to when we added App.xaml and we spoke about GestureRecognizers for the back button, well now is when you want to add a method for that button to call. As you've already seen, we called a method named 'OnBackButtonPressed'. App.xaml is the file that will handle this method so paste the following code into it and your back button should work.

So that you can confirm you've got yours set up correctly, here's what your App.cs should look like now:

Now if your app doesn't yet have a main page to load when it starts, now is when you'll want to add it, use the same method we've already covered above for adding a new xaml page to your project, you can even add it under a folder if you want to keep the project tidy (which you should). Notice that in the example above, I create a new MainPage and wrap it in a NavigationPage then set the applications main page to it. This loads the class within the MainPage.xaml file and also allows my app to control navigation using the navigation stack. In case you didn't already know, the navigation stack is used to push and pop pages to and from the users view.

Another thing to look at in the example above is how I set the NavigationPage to a variable in App.cs, some would frown upon this so do it at your own discretion, all this does is allow me to push an pop pages from my navigation stack by calling 'App.Navigation.PopAsync();' instead of '((NavigationPage)Application.Current.MainPage).PopAsync();'

All that's left to do is to go through all the page cs files that this affects and turn off the default header/navigation bar by adding the following line to the page constructor:

And add this line the ContentPage element within the xaml page files:

Your content pages shuld look something ike this

Conclusion:

How To Use Custom Navigation Bar App With Mac Pro

So turns out that this is a very simple and neat way to get what a web developer might call a partial view setup in Xamarin, almost like how masterpages used to work where you define the template and then specify where you want the content to load.

How To Use Custom Navigation Bar App With Macbook

Other Resources:

Xamarin forums post that helps with a few tricky bits:
https://forums.xamarin.com/discussion/31872/application-resources-staticresource-not-found-for-key

Brilliant blog post by wolfeprogrammer that helped my understanding of this a lot:
https://wolfprogrammer.com/2016/07/07/custom-app-header-in-forms/


By Luke Alderton

How To Use Custom Navigation Bar App With Mac

Published at 10 Jan 2017, 14:15 PM

Tags: Xamarin,C#,Xaml,Android,iOS,Windows Phone

Comments

Sit tight...
We're adding your comment.

How To Use Custom Navigation Bar App With Mac Os

There's been a problem.
Please try again later.