Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the better ways of adding UWP to Grial-UI #367

Open
chrisgate opened this Issue Feb 15, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@chrisgate
Copy link

chrisgate commented Feb 15, 2018

Since UXDivers are not supporting UWP for any reason.

From the community what is the better ways of integrating UWP to the downloaded Grial-UI project.

Thanks.

@chrisgate chrisgate changed the title What is the better ways of add UWP to Grial-UI What is the better ways of adding UWP to Grial-UI Feb 15, 2018

@LeoHere

This comment has been minimized.

Copy link

LeoHere commented Feb 26, 2018

Hi @chrisgate,

Sorry for the delay.

There are 3 main challenges in order to run Grial in UWP:

  1. Initialize Grial, including validating the license.
  2. Have all the dependency services Grial relies on in place.
  3. Have all the custom renderers in place.

Solving 1 and 2 is a must, if not runtime exceptions will be thrown as soon as you run your app. The absence of custom renderers (3) will cause visual issues but should not tear down your app. So you can leave those for a second round.

In order to run Grial in UWP you will need to:

  1. Create your UWP project and reference your PCL project (where XAML's reside)
  2. Add a reference UXDivers.Artina.Shared.Base, UXDivers.Artina.Shared and FFImageLoading packages to the UWP project
  3. Add a reference to UXDivers.Artina.Shared.UWP.dll assembly to your UWP project (*)
  4. Register all the dependency service Grial relies on (**)
  5. Copy the GrialLicense to the root of your UWP project and set it with build action Embedded Resource.
  6. Change the initialization of your UWP to:
Xamarin.Forms.Forms.Init(e);

// Initialize license passing the ResourceId of your license
UXDivers.Artina.Shared.License.Init("<REPLACE WITH YOUR UWP PROJECT DEFAULT NAMESPACE>.GrialLicense");

// Initializing FFImageLoading 
CachedImageRenderer.Init(); 

// Register implementation for services 
Xamarin.Forms.DependencyService.Register<UXDivers.Artina.Grial.UWP.DeviceSize>();
Xamarin.Forms.DependencyService.Register<UXDivers.Artina.Grial.UWP.DeviceOrientationLocator>();
Xamarin.Forms.DependencyService.Register<UXDivers.Artina.Grial.UWP.CultureServiceLocator>();
Xamarin.Forms.DependencyService.Register<UXDivers.Artina.Grial.UWP.LayoutDirectionService>();
Xamarin.Forms.DependencyService.Register<UXDivers.Artina.Grial.UWP.MirrorService>();

After doing the above you should be able to run the UWP version of the project. Since there are no custom renderers there are several stuff that will not look good, still you should be able to see most of the screens if not all.

(*) This assembly is NOT included in the UXDivers Nuget packages. Please email me to l r o d r i g u e z at uxdivers.com and I will send it to you.
(**) Once you email me I will also send you a dummy implementation of those services too.

@TopperDEL

This comment has been minimized.

Copy link

TopperDEL commented Sep 19, 2018

I mailed you to get the DLL and to try UWP-Support. What stops you from making this "official"? At least provide the DLL via your nuget feed?

I would love to see UWP supported, as having all three platforms supported is what is all About Xamarin.

@LeoHere

This comment has been minimized.

Copy link

LeoHere commented Sep 20, 2018

@TopperDEL I have just email you.

@chrisgate

This comment has been minimized.

Copy link
Author

chrisgate commented Oct 2, 2018

@LeoHere I second @TopperDEL ,i wonder why we have to mail to support for UWP at all.

Do you know i abandon Grial UI bcoz no support for UWP.

How do you mail it to me?

Thanks

@LeoHere

This comment has been minimized.

Copy link

LeoHere commented Oct 3, 2018

@chrisgate, @TopperDEL UWP is always on the table when we discuss what's next. There are some customers (as you guys) asking for it, but not enough for it to jump to the top of the backlog. What we provide here is just a workaround to be able to execute Grial in the context of UWP. We do not support UWP. Making it official implies a considerable amount of work on implementing it, testing it, etc.

If you want to go through the UWP path you will need to implement several things on your own. We can help you providing guidance. Some customers had gone in that direction and succeeded.

@chrisgate I can't find your email based on your Github user. Please write me an email to l r o d r i g u e z at uxdivers.com and I will answer back sharing this stuff.

@TopperDEL

This comment has been minimized.

Copy link

TopperDEL commented Oct 4, 2018

@chrisgate I managed to get UWP working but currently only with an older Grial- and Xamarin-Version. I would have to create a new solution and add grial manually to get it possibly working with the latest versions. But by downgrading I could use the ready-prepared grial-solution they provide. So far everything is working and I'm happy. I would love to see UWP officially supported, though, but I also understand Leo's comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.