CustomNavigationBarSample icon indicating copy to clipboard operation
CustomNavigationBarSample copied to clipboard

How to implement it with PRISM.Forms?

Open vhugogarcia opened this issue 7 years ago • 7 comments

I would like to thank you for this amazing custom navigation page.

However, I'm trying to implement on a project that is using PRISM.forms from Brian Lagunas. I'm not quite sure how to create a custom navigation page there.

Do you know if it is the same process or what should I consider for that? I'm using v7 of Prism.forms

Thanks in advance

vhugogarcia avatar Mar 10 '18 04:03 vhugogarcia

Would be same process because uses attached properties just be aware to register your custom navigation page instead of default Xamarin forms navigation page.

rdelrosario avatar Mar 10 '18 12:03 rdelrosario

Thanks @rdelrosario I implemented on my project using PRISM, however, I'm getting a weird error on Android:

Cannot access a disposed object.
Object name: 'Android.Support.V7.Widget.Toolbar'.

I checked the packages on your Android sample project and I can confirm they are the same I have installed on my project, the difference is that you are using Xamarin.Android.Support.v7 libraries version 26.1 and I'm using 25.4 should I upgrade?

I'm using Xamarin.Forms latest stable version 2.5.0.280555 and Xamarin.Android.Support.v7 libraries version 25.4

Here there is screenshot of the issue: https://s14.postimg.org/ikoq8t5q9/Screen_Shot_2018-03-10_at_1.58.19_PM.png

Any idea?

vhugogarcia avatar Mar 10 '18 19:03 vhugogarcia

Hello @rdelrosario , I went ahead and upgraded to the same Xamarin.Android.Support libraries version you have on the sample and now they match, however, the same error mentioned above is still present.

Any idea is always welcome

Thanks in advance

vhugogarcia avatar Mar 10 '18 20:03 vhugogarcia

Try commenting that line. I think Prism might handle dispose of toolbar a bit different. Try that and let me know.

rdelrosario avatar Mar 10 '18 22:03 rdelrosario

Hello @rdelrosario the error is gone by commenting that code line, however, the title image is not being rendered at all.

Here a code screenshot I'm using too add an image as title based on your example: https://s14.postimg.org/4h73p29c1/Screen_Shot_2018-03-11_at_11.25.28_AM.png

I also tried adding the extension to the image path when invoking the code without luck.

vhugogarcia avatar Mar 11 '18 17:03 vhugogarcia

this is on iOS or Android?

rdelrosario avatar Mar 12 '18 22:03 rdelrosario

it happened on both platforms yeah.

vhugogarcia avatar Mar 13 '18 14:03 vhugogarcia