Pull the navigation drawer from the side in code - xamarin.forms

I am looking for a way that way that in a certain interception I should be able pull the navigation drawer from the side in code.

MasterDetailPage has an IsPresented property that controls whether or not the master is visible
Gets or sets a value that indicates whether or not the visual element
that is represented by the Master property is presented to the user.

Related

Xamarin Forms Button set Content

I have a very common problem, but I couldn't find any valid solution.
I want to create a Button able to contain more than a simple Label or Image. In fact, Xamarin Button exposes only Text and Image properties, but in my case I want to construct a more flexible set of controls (e.g. a StackPanel with a list of controls).
I implemented a ContentView acting as a Button after having added TapGestureRecognizer and it works from the pure functional point of view. What I don't like is the missing of all Visual States of a Button.
Therefore, I was thinking how to implement a Custom Renderer of a Button. I would like to expose a ContentPresenter BindableProperty and then set that property to the Button.Content (speaking in UWP terms) in the Renderer class. I think this could be a solution, the problem is that I don't know how to "cast" a Xamarin.ContentPresenter to a UWP.ContentPresenter. Do you have any idea about how to implement a Button able to contain any generic Content?

Open Additional Fragment

Is there a way to open a second Fragment Page? (ie. open multiple fragment pages at the same time)
I have a database setup and when users click a button a Fragment Page pops up so they can edit the fields. I would like to try and have a sub-menu appear for comments (so they don't have to scroll all the way to the bottom of the screen).
Something like the Menu in the Material Gallery Sample would be great.
Note:
I am currently using app.showDialog(app.pageFragments.Menu); to open the Page Fragments.
Having both Fragments open side by side would be a usable options as well.
Thanks!
Here is an example diagram.
Sorry for the late reply. I'll put this as an answer because I think it will get you what you need. You could implement this if you put the page fragments directly into your page, and toggled their visible property to show/hide them.
The biggest trick here is how does the first page fragment tell the second to open? That ends up being simple, just add a custom boolean property to the first fragment. Then in the base page (which contains the two fragments) bind the visible property of the second fragment to the custom property of the first fragment. Then in the first fragment, you can set that property to "true" when you want the second fragment to show, and "false" when you want it to hide.

How to determine whether a DisplayObject has been rendered

I'm puzzled about whether the visible property of DisplayObject is:
an indication from Flex of whether the display object is visible.
an instruction to Flex to display the display object.
I'm asking because I'm automating some Flex tests using Flex Pilot, and I need to know for certain when a display object becomes clickable. In the application I'm testing, clickable seems to mean rendered.
Given the nature of the application and my tests, I don't think it's feasible to watch for the updateCompleted event. I need a way to detect whether the display object is visible based on the values of its properties and its containers' properties at a given moment.
I understand that even if a display object's visible property is true, it will be visible only if all of its containers are also visible. This means that I'll have to extend Flex Pilot by writing an ActionScript method to determine whether the display object and its containers all have visible=true. But I'm concerned that even that method won't tell me for sure that the display object is really rendered, and therefore clickable.
My puzzle comes from reading two descriptions from Adobe.
The "About creating advanced components" document suggests that the visible property is set by Flex after the display object is rendered. In this description, it is Flex's job to set the value,
so that value is thus an indication from Flex of whether the display object is visible.
On the other hand,
Adobe's description of the visible property suggests that the property is writable. And the code sample suggests that if the application changes the value, Flex will respond by displaying or hiding the display object. In this description, the application sets the value as an instruction to Flex to display the object. I'm guessing that in this case Flex re-renders the display object (if visible changes from false to true) or its container (if visible changes from true to false).
So two main questions:
Is the visible property used in both of these ways, both as an indication from Flex about the display object's visibility and an instruction to Flex about whether to display the object?
If the application changes visible from false to true, when does the display object actually become visible? Is it visible by the time the setter returns? Or does setting the property merely schedule the object to become visible during some later event? If it's the latter, that means there may be a duration during which visible is true, but the display object has not yet been rendered. If that's the case, I'm at a loss for how to determine, from the state of the display objects at a given instant, whether a display object has been rendered.
There are some key constraints for a DisplayObject to be rendered. First of all, it has to be in the display list. visible has to be set to true, otherwise it would be ignored from the rendering. The last key aspect is the so called elastic race track which basically describes when event handling, code execution and rendering occur. So, implementing event handlers for FlexEvent.UPDATE_COMPLETE is not so wrong, because those are dispatched when ever a property changes, which change the rendered representation of the component on the screen.
Is the visible property used in both of these ways, both as an indication from Flex about the display object's visibility and an instruction to Flex about whether to display the object?
Yes, the visible property is initially set to true by the framework before FlexEvent.CREATION_COMPLETE is dispatched, so the Flash player won't draw the component in a state (i don't mean the Flex view states), which is some where between construction and having the complete initialized view.
If the application changes visible from false to true, when does the display object actually become visible? After the next render cycle happend.

Flex custom component first item not read by JAWS

Flex application is being made accessibility compliant. When a custom component is made visible based on some condition, the first item (either text or formitem or textarea) inside the component is skipped by Jaws. It reads from the second item. On pressing UP arrow, the first item is then read.
Is there a way to make the first item accessible without need for pressing UP arrow?
This is likely going to be related to focus management.
You're likely going to want to assign componentId.setFocus() to the first component in the current view when the view state changes.
You need to re-assess the focus when the state of your display changes. If you post how you are managing display state I can suggest exactly how to trigger that via an event or in your custom state method.
Also, if that doesn't work, try this once your screen is ready / state changed :
focusManager.moveFocus(mx.events.FocusRequestDirection.TOP);

How do create this gmail app effect on Honeycomb

Attached is the screenshot of the UI that I would like to have in my app. When I click on the listitems on the fragment on the left side I see a arrow pointing(question mark in red) on the list item which was clicked, I would like to know how can we achieve this in UI layout. Any special settings to be set?
I was looking at the same feature.
To implement similar, I'd suggest showing an image on the selected item in the list, this would require code rather than Layout XML, It would be controlled by the list fragment when an item is selected. That way you get the visual effect that the two fragments are related via the arrow image.
Did you end up giving it a go for yourself?

Resources