Prism-Samples-Forms | Samples that demonstrate how to use various Prism features | Form library
kandi X-RAY | Prism-Samples-Forms Summary
kandi X-RAY | Prism-Samples-Forms Summary
Samples that demonstrate how to use various Prism features with Xamarin.Forms.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Prism-Samples-Forms
Prism-Samples-Forms Key Features
Prism-Samples-Forms Examples and Code Snippets
Community Discussions
Trending Discussions on Prism-Samples-Forms
QUESTION
I am playing around with Xamarin.Forms (mvvm) with Prism and have noticed that some tutorials show navigating to another Page while others show navigating to a View.
At a high level, I understand the literal difference... however I do not understand when I should use one over the other? I have an inclination that some of the reasoning is around dependencies, for example:
A Page has the instance of User
> navigate to a view = User
is still present when the back
operation is used... meanwhile if you want this same behavior in navigating to
and from
a page, you'll need to pass the instance around via parameters... Is this correct/the reasoning behind navigating to and from views
instead of pages
?
ANSWER
Answered 2018-Mar-04 at 11:20Technically, in pure MVVM, the ViewModel
should know completely nothing about the View
and vice versa. When you use Page First Navigation
approach you violate the first sentence. Here is an example:
QUESTION
What is the equivalent of this code(DryIoC) in Unity?
...ANSWER
Answered 2017-Aug-21 at 09:42Container.RegisterType( new ContainerControlledLifetimeManager() );
QUESTION
So to continue on with my first foray into Xamarin, I'm trying to develop an Content page that will take a photo, and then save the photo on the device gallery for viewing. I'm using Prism with Autofac and I'm following the wiki documentation on DependencyService and the examples that was provided on GitHub, but the program is crashing without explaining why.
I hate that!
So, here's my interface:
...ANSWER
Answered 2017-Apr-05 at 12:26I'm putting in the answer here just in case someone else has the same problem as I do in the future. Also, since there's little documentation, and I had to cobble together this alternative solution from a Chinese website (of all places!) and discussion with some of the guys on Slate Prism-Forms channel, I thought it would be best to put it out there on the alternative solution so at least you get an rudimentary idea on to resolve the DependencyService issues, and workarounds using Autofac DI.
I do want to note that there is discussion going on the Prism GitHub that Prism's implementation of DependencyService should be depreciated and go through this alternative that I'm describing here in this post. So hopefully one of the guys on the development team will document it and give better code examples on what I'm showing here.
That said, on with the show...
Okay, so I found out the answer to the problem. Long story short, the problem is the Autofac container.
And now the long winded version.
From what I gathered Dan Siegel, of all the containers that Prism can implement for a IoC/DI container, I had to pick the one that doesn't play well with others!
Why, do I say that it doesn't play well? According to the Autofac documentation, the container is Immutable which means it cannot be modified once it's been built. So my hypothesis is that when Prism goes through the project and tries to add in the registration types of DependencyService, Autofac is balking because the container is already built and therefore the "Unhandled Exception" is being thrown.
That explains the issue, but not the solution.
And what is the solution? Well, it turns out that Brian (Lagunas) and Brian (Noyes) have implemented a new interface called IPlatformInitializer, and I therefore have no choice but to use ContainerBuilder.Update(container) to add in the new RegisterType, which implements the additional RegisterTypes for the DependencyService, and I had to implement it like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Prism-Samples-Forms
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page