debug Navigation stack, xamarin.forms - xamarin.forms

My little app was working, then I tried to change the navigation a little and now it crashes at
await Navigation.PopAsync();
I wonder if there is a way to be able to see the navigation stack, to know what would be expected when i do the Pop. I use PushAsync to get to this page, but since it crash here, I maybe screwed up somewhere else...

You have access to the Navigation Stack by calling Navigation.NavigationStack. If you want to know what is in there you could find the Type of each object within it.

Related

NavigationService won't navigate after going there via absolute Navigation

I am currently working on a Xamarin.Forms application that is targeting UWP, iOS and android.
After implementing a login dialog I am navigating a logged in user to a SomeContentPage, which I now want to be enclosed into a NavigationPage (and perhaps later on inside a MasterDetailPage).
I am trying to reset the navigation stack by using a /-prefix for a absolute navigation route, which will bring the user to the desired page and clear the stack:
await NavigationService.NavigateAsync("/NavigationPage/SomeContentPage");
Following, from this page there is no more relative navigation possible:
var navigationResult = await NavigationService.NavigateAsync("AnotherContentPage")
It seems like that there is everything going well "inside" the navigation system (navigationResult.Success is true) but the app is not navigating to the AnotherContentPage at all.
If I navigate without the /-Prefix, the upcoming navigation calls work as expected:
await NavigationService.NavigateAsync("NavigationPage/SomeContentPage");
I am really concerned and I already investigated very hard on this.
I don't know if I am just not understanding something properly in the Prism.Forms NavigationService concept or if I am trying something impossible here.
I re-read the Prism.Forms documentation, watched several YouTube-tutorials and read many blog posts about navigation in Prism.Forms.
I am near to desparation right now.
I really feel bad asking this and I am really questioning my internet-research-skills at this moment, but it would be great, if someone of you could give me some advice, how to handle this.
Thanks in advance and have a nice day!

Hiding objects in unity without changing their state

I have a vague memory of a Unity video tutorial where the guy hid some objets while building a scene. The thing is that he dind't use the usual 'disable/enable the object via the inspector checkbox' and so he didn't have to worry to enable them later... moreover, as the objects were 'invisible but enabled', all attached behaviours were working.
As far as I remember the effect was pretty similar to moving the object into a hidden layer (but not changing the object layer but using a different Unity built-in action so he actually dind't change anything in the object).
I've been trying to remember how he did such a thing and looking around the editor to find the specific option but with no luck. Honestly, I'm beginnig to think that I might not be remembering correctly. Do anyone know about this 'hide objects without changing them' command?
Regards!
Sounds like he might have just turned the object's renderer off. Each GaneObject is going to have some kind of renderer as a property in the inspector (sprite renderer if its 2D, ect). He probably just disabled that as opposed to disabling the entire GameObject. Let me know if that helps!
I've just received by chance a link to a video on twitter (I think it's the very same I was trying to remember but I'm not 100% sure). Anyway it seems that my current Unity version 2018.3.3) doesn't include that 'Scene visibility' toggle; it seems to be available for 2019 Beta. . I didn't test it yet but it seems pretty straightforward, just click on a gray bar in the hierarchy bar, to the left of the object you want to 'hide'; the bar seems to work as a an visible/not visible toggle. Here a link to de video where you can see the thing working!
I hope it helps!!

2sxc: Changing getting started dialog of apps

I'm trying to develop my first app, starting to create a new one...
I can't find in documentations where to change the getting start dialog https://snag.gy/JWliB7.jpg
I'm looking everywhere, configs, settings but no luck.
Any help please?
The getting started as of now is tied in with the app catalog. The reason behind it is fairly complex, but we basically wanted to make sure that the getting-started comes from outside the app itself, so that security warnings etc. could be shown at a later time.
If you need a kind of a "user getting started" and not an admin/developer getting started, for now I recommend that you create a view like "0 getting started" so it's the first to be shown, and in those instructions you can also explain how to set this view to hidden once the user understands all.

Adobe Extendscript Photoshop Guides Visibility

Is there a way via extendscript (jsx) to get the visibility status of Photoshop' guides?
The code to show and hide the guides is the same code as it 'toggles' the guides on or off so it must know the status when this code is executed, but how do I get at it?
I appreciate this could be done via a preference switch but that seems an awkward hack for something this simple, especially as something somewhere must be accessing this 'property' during execution of the 'toggle' code.
What would be great is to have activeDocument.guides.visible property, returning either true or false. Is there anything like that?
EDIT:
OK. Further investigation reveals that creating a guide using guides.add does not automatically toggle guides ON, however, using the code generated via the scriptListener does.
I would rather use guides.add as its only one line of code compared to fourteen so in order to toggle the guides to ON I thought I could run a function that created and then deleted a guide using the scriptListener code during the onLoad of the HTML.
This works great, except getting this function to run only when a document is opened is now the new problem.
documentAfterActivate is supposed to be the code to do this except it doesn't work unless a flash panel such as kuler is opened first.
So the question now is really what part of the flash code is allowing documentAfterActivate to work properly and how can I use it in my code instead of opening a flash panel I don't need?
It doesn't look like you've got a direct toggle option. You'd need to record the position of the guides somewhere and use script listener code to clear them when you wanted to toggle them off and use the add method on the Guides object to re-add them.
Keep in mind that even getting to the guide position via the photoshop DOM wasn't avail before CS4 I think? maybe CS5.
And i realised I just mis-read your question quite a bit. Anyway, this way you'd also know if the guides were visible based on whether or not they are there :) But yes, it isn't as nice as it could be.
The solution:
As stated, the workaround is to create and delete a guide with the fourteen lines of code from the scriptListener.
This toggles the guide visibility to ON regardless of its current state.
I can then save this status as a preference using putCustomOptions.
A function to do this is fired during the onLoad of the HTML but only when a document is opened otherwise guide creation fails.
documentAfterActivate does not work as expected unless a further flash panel (such as Kuler) is also opened beforehand.
An alternative to documentAfterActivate is to register the open event using CSevent instead.
The code can be found HERE.

What are some good patterns for managing a bunch of views/screens in Flex?

I'm building a Flex application with about a dozen different screens. There's relationships between the screens such as when on screen 1, I click on something that is an input to screen 2. Then I might bring up screen 3, then go back to 2 and then bring up screen 4. To make it clear to the user where they are in the application, we'd like to implement a breadcrumbs concept where the user gets to see which screen they are and be able to navigate back up the trail they came from.
So in thinking about how to implement this, it seems to me that I should have a stack of views. Views get pushed onto the stack, then popped off. The breadcrumbs would be a visual depiction of that stack, eg: Home >> Alert 123 >> Customer B Summary >> Customer B Detail
Having said this, I'm trying to come up with a pattern for how to implement this. The obvious starting point would be a mx:ViewStack as a container. Then I'd add views as children and make them visible - effectively "pushing" then onto the view stack. Then to close that screen I'd remove them as children to "pop" them off. This would have to update some stack data structure somewhere that the breadcrumbs would be able to see. In fact the breadcrumbs themselves can modify the stack when the user clicks on an item in the breadcrumbs to jump to.
In any case, I'm going to be working on this but just curious if anybody has anything to share around any patterns/frameworks you've used to manage multiple screens and how they come up and go away and navigate between them that I can use for some ideas.
Seems like a simple thing but in practice it's not always straight-forward.
MVC i think would be helpfull to orgenize your code and have a rebustable application .
There is no 100% design pattern ,most times it is the way you implement it .
I find mvc great when having many views because it keeps your mxml pretty clean and small and when you add features you do it in a pure as class which keeps your code from complicationg.
Just throwing some ideas, hoping it can help ...
Maybe you could use the memento pattern? Or use a command pattern with a CommandStack?

Resources