Add/remove usercontrol in panorama item using MVVM - Windows Phone - mvvm

I have a panorama app that has two panorama items so far, "recent" and "popular." These get populated with data using binding from a viewmodel. I would like to add a third ("search") panorama item that initially shows just a text box and a button.
When the user inputs text and clicks on the button, I want the text box and button to be replaced with the ListBox control that shows the search results.
I cannot find any examples on how to do this using the MVVM pattern. I am not using a MVVM framework and would like not to since I am just learning all this.
If you can explain or better, point me to examples that will allow me to do this, I would very much appreciate the help. If I left out any required info in my request, please let me know.
Sincerely,
Kamal

Typically for something like this you would have a property in your ViewModel that would tell the view what to show. You have lots of different options for how you could do this.
One option would be to have a Results property that your list box is bound to. Put the textbox and button in a Grid and bind the Visibility property of the grid to a property that is Visible is there are no results and not visible if there are.
Lots of different ways to do this.
Examples here and here.

You could probably bind a list of a custom class to the panorama ite .
The custom class contains a title and/or description and a page class.
You can maintain your views in your main viewmodel.
Another solution would be adding the items in xaml and using the same viewmodel for the whole panorama item control. With a property you can control the visibility of each item.
Like Bryant said: there are so many solutions. It depends on your application and requirements... :)

Related

How to link the selections in Nattable shown in a custom editor view to the sirius property view in eclipse?

I have a question regarding the linkage of the selection made on the nattable in a custom editor view and the sirius property view. Any ideas, how should i go for it, it will be really kind of you if you can highlight the steps in an easy to understand manner, because i have researched a lot on it and nothing is concrete enough to get me started to solve this task.
I am attaching two screenshots describing, what is the nature of the issue i am facing and what i want to implement.
Screenshots>
1. https://imgur.com/bVqfGc4
In the first screenshot, when i click on the element in the model explorer , its properties show up in the sirius properties view, and they should as that is how sirius property view works
2. https://imgur.com/DKsFQBi
In the second screenshot, when i click on any element on the nattable in a custom editor view containing my nattable, the sirius property view does not respond to the selection made on the nattable in that custom editor view.
I want to implement a solution where when i click on any element in the nattable, its properties hsow up in the sirius property view.
Your help and guidance in this regard will be highly appreciated. Thanks in advance.
Best Regards,
Abu
You need to implement and register an ISelectionProvider. NatTable provides currently only row based providers like the RowSelectionProvider or the E4SelectionListener.
The corresponding examples can be found here:
https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_505_Selection/_5054_SelectionProviderExample.java
https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.examples.e4/src/org/eclipse/nebula/widgets/nattable/examples/e4/part/SelectionListenerExample.java

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

show and hide tabs dynamically in touch ui -AEM

I have a requirement, where I need to show few tabs on selection of a value from a drop down.
I have done this in classic UI. But not sure how to proceed for Touch UI. I know that we can use JQuery, Can anyone let me know the approach I can use.
Its fairly simple, look at the OOTB List Component /libs/foundation/components/list. The selection dropdown is defined - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom, look at property class and cq-dialog-dropdown-showhide-target these are used to manage hide and show.
Now from here look at the dropdown values under - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom/items these values trigger the hide and show mapping to property showhidetargetvalue as in /libs/foundation/components/list/cq:dialog/content/items/column/items/setDescendants

iOS: Search Options UI

I am building an iPhone app for a library and I want to give few options to the user to search books by. A user can search a book by title, author, topics, or date of publication.
What I want to know what's the best way to display these search options to the user? In terms of HTML, it would be easy - either use a drop down list or radio buttons. I tried using UIPickerView but honestly, that looks terribly ugly and destroys the aesthetics of the view of my app.
The other option I was thnking was using segmented control, but is it possible to have a vertical segment control in stead of horizontal one? The selection texts can be too long.
Any ideas?
If you want a vertical segmented control, you'll have to make it yourself. Create a textured image with dividers. I would export each section as a PNG separately. Then create a picture of each section with the "pressed down" gradient and export each segment as a separate PNG again.
I would then make a new class. If there is a specific number of objects in your segmented control or this is a one time thing, the class may not even be necessary. If not, then in the class constructor pass an array with the titles of the segments in your segmented control. For the first and last objects, use the pictures you made with rounded corners. For the objects in between, use the standard pictures. Then put the titles on top. When a segment is tapped (perhaps use hidden UIButtons), you can use a delegate method to tell the main search class which one was tapped, and then the class can replace the normal picture of that segment with the pressed down one.
Thanks for the options.
I ended up creating a simple table to show my choices.
User clicks on "search by", which opens up the table with options and then when you select any option, you return back to main view with the chosen search option.

View state, new activity start

I use the MVP pattern in my project. According to it Place define view after a new Activity starts. In some cases when I have to save the content of some Text areas after change of Place. I think that it is not a good idea to put these text areas in Place, because they don't define business logic. To save them in View elements is not good either. How do I resolve this situation?
GUI elements (GWT widgets) belong in Views. Why do you think otherwise?
Then your View interface (or is it Display?) can have getTextData()/setTextData() methods to retrieve data in your TextBox.