Xamarin Forms, Adding items dynamically inside CarouselView on the run, Strange Behaviour - xamarin.forms

I use the same DataTemplate to populate some of the views inside my CarouselView: a XAML file with a ContentView. I assign a custom class list to ItemsSource of the carouselview AND use bindings inside the template layout fields to fill them with the properties of my custom class. Everything is working fine. Here comes the wierd part: Let's say there's a button in the template and when you click it on the screen, a Label with "Well Done" text is added to the current Stacklayout of the shown carouselview. This is done by the codebehind of my template XAML. This is ok, too, but I expect this "Well Done" to disappear after I swipe back and forth enough. Because it's not part of the template. It does not disappear, instead I see it on other carousels once in every 4 swipes and it is replaced, I mean it appears on different carousels if I swipe back and forth. To make it disappear completely I have to swipe away from the views that share the same DataTemplate. I cannot understand the mechanics behind this behaviour. I can create another field inside the template to put the "Well Done" text there and show it when the time comes, I know. But I want to understand the mechanics. Thank you.

Asking the right question about a problem is the key to any solution..
After the realization that I've mentioned at the Update comment, I've searched for DataTemplate Caching and found this issue post on Xamarin.Forms Github: https://github.com/xamarin/Xamarin.Forms/issues/9200
There you can find an explanation to how CollectionView was designed and understand the mechanics behind the behaviour. No bug. It's by design.

Related

Google VR Reticle Click on UI Button

So I am having this issue with using Google VR reticle where I cannot click a button. I have an image attached showing the heirarchy and the PlayButton is what I am trying to click. The Canvas has a Graphic Raycaster, the button has an Event Trigger that calls the method to navigate to the next scene. The UpScrollPanel, and DownScrollPanel work just fine. The EventSystem has the Gaze Input Module, as well as Event System, and Touch Input Module.
Any ideas on how to get this working? I have watched a few videos from NurFACEGAMES and while they helped a little, I haven't gotten the click to work yet.
Oh, and I am using Unity 5.3.4f
Sometimes things can get in the way of the button, make sure that no other UI elements overlap it, for example text borders (which are actually larger than they appear). You can also fix this by moving the button up the hierarchy among its siblings, I believe the first child is top.
Also try moving the button up the hierarchy if possible, sometimes UI having certain parents makes them not work
The canvas object should have a graphic raycaster
I found the issue to be unrelated to anything I thought it was. The menu I was using is a prefab I also use in another view that isn't VR. The scrollrect was loading that prefab, instead of the modified one I was using in the VR menu, and therefore the triggers I had added to the button were no being used when the app loaded.

Editing the navigation controller from push segue

So i have a static tableview with 4 rows, i'm connecting them to different viewcontrollers without using any code instead i'm simply dragging the cell and setting up the segue.
The issue i'm having is that when this segue is performed a navigation controller is automatically generated and embed at the top so i get the following result below.
How could i edit the text and the icon? I want to remove the settings text and use my own custom icon.
It's also worth noting that i have embed other navigation controllers throughout my app. So i'd like to target this view specifically rather than all of my views.
I suspect the accepted answer on this question may help: how to replace/customize back button image in storyboard navigationcontroller
You'll need to do it in your prepareForSegue I believe.

How do you force Combobox dropdowns to stay open

How do you force Combobox dropdowns to stay open even when other Alert boxes appear. Looking at what to subclass from mx.Combobox, there doesn't seem to be much that i can do to short of implementing an entire combobox from scratch.Thx
For that you need to create a custom ComboBox which if created in following Link. and might be this link will going to be useful to you.
Please visit this LINK

UINavigationController with UITableView in modal popup (on iPad)

Short Version:
"How do you get a simple UITable drill down UINavigationController-styled non-full-screen modal dialog on the iPad?"
Long version:
I have a very specific set of requirements that I can't seem to get working...
I have a functioning iPad program that that needs to pop up a non-full-screen modal view. This modal needs to have a navigation controller and a simple drill-down table that displays a detailed view that I can have edit some values related to the selected item in the table.
Of course I am looking to have the regular "Back" and "Delete" buttons in the Navigation Bar.
I can handle the detailed view, what I am having issues with:
Non-full-screen popup (mine is
always full screen no matter what I
try).
The Navigation controller will not display the Table View I tell it to and the navigation bar does not even have the title I assigned to it in IB.
I can't seem to get any of this working. If anyone has a step by step example of how to do this, that would be great,
~Eric
P.S. I am not afraid of doing this 100% programmatically, but all the examples I have been trying to follow (and failing at extending to my problem) use IB.
As for the fullscreen issue, you need to set modalPresentationStyle to UIModalPresentationFormSheet or UIModalPresentationPageSheet on the controller you want to present modally. I'm not sure of a way to do this through IB.
As for your navigation controller/table view, I think more information is needed to provide an answer.

Navigation issue in Flex - ViewStack, states or something else?

I have a bit of doubt regarding my application which is being created using Mate framework. The first thing user has to do is to log in, so I created Login.mxml view. After a successful login I need to display the main view with applicationControlBar at the top and a workspace below. At the moment I have two separate views, so if I understand correctly it makes sense using ViewStack.
Thing is, I'd like also to display some kind of panel with buttons on top of the workspace after login - here is screenshot. After clicking on a button the panel should dissapear. To complicate things a little bit more, there is a possibility for this panel to change state. Clicking on a specific button may result in showing progress bar at the bottom of panel.
I feel I should create separate view, MenuDialog.mxml and put there buttons, progress bar and states, but how to display it on the top of the workspace? I hope my problem is clear enough :)
I would make the panel a popUp, with the main application (or the ViewStack's parent container) as the parent of the popUp. You can use the PopUpManager Class to close it based on user actions within the Panel.
Assuming that perhaps you do not want a modal login style panel (which many apps these days eschew) then you should absolutely use states rather than ViewStacks.
States are a much cleaner way to distinguish the various, uh, states that your UI can be in -LOGGED_IN, LOGGED_OUT, etc.
It may take a little to get used to working with states, but once you do, you'll never go back. :-)

Resources