I'm currently developing a Windows 8 Store app that uses a Grouped GridView in the HubPage showing Highlights for some Categories. So far, when clicking the Header you see More Highlights for this Category.
Now i want to add a control at the end of every Group leading the User to the "non-highlight" Category site, where just all the Items of this category are displayed.
Is there an easy and elegant way to do this - propably with a Template is suppose.
( i think the latest Bing-News-App has a similar feature )
Thanks in advance for every help.
There are a couple of ways you can do this.
You can add an arbitrary object to the end of your group, then use a DataTemplateSelector to style it.
You can create your own VariableSizedWrapGrid with the control added to the end in the constructor (slash "Arrange"). You can then add an arbitrary click handler as a dependency property and only show the button if the click handler is set, so you can reuse this on other pages, etc.
You can change the GroupStyle to include something similar at the end of the group, but it likely won't animate with the other items in the group (if that's important to you).
The easiest one to do is probably the first one. If your group is a list of SampleItems then make a subclass of the SampleItem class called something similar to TerminalSampleItem. Create a template for it (like you've made other data templates). Make an ItemTemplateSelector that has two properties, NonTerminalDataTemplate and TerminalDataTemplate (assuming you only have two data templates). Have the SelectTemplateOverride function check for (item is TerminalSampleItem);
Related
I don't want to use 'users' menu item and want to manage users from another menu item named 'Merchant' and only a specific user group data will be there and while creating new record I want to set a specific user_group. Is there any approach for that?
You can simply add the menu directly under your module. Get the menu for res.users and put where ever you want. Don't forget to add dependency to base.
While doing that you can add a domain to the menu item and filter according to your needs.
Also put that domain into the context of the menu with giving a default value same as the domain. That is, you need to put the required settings in the context like {default_FIELD_NAME: VALUE}. You need to use the default_ prefix for it to work. That way when creating a new user from your menu the context will get the default value and set accordingly. However, if it is not a readonly field, user may change the value. There are two ways to avoid that:
i. create your own form using the res.users and design it the way you like it with default values.
ii. inherit the view of res.users and change the related field to be readonly if a certain context value is passed. Then you can call the view with context let's say {readonly_group_x: True} and it should work. Also you may need to make sure that force_save="1" is set since it may not save the readonly field.
These are the basic steps of accomplishing what you have described. However, working with res.groups can be challenging depending on what you want to do. You may need to tweak or even end up creating your own view with the desired effect.
In my project, I need to create a list of feeds, something like:
I think to create a XAML content view, but how can use it as a cell?
Is it a good approach?
I think the best way to go is to choose Data Template Selector. If you use Data Template Selector, You can Choose a DataTemplate (view) at runtime based on the value of a data-bound property. Lets say, In your case, your List view might have 3/4 or any number of different kind of ViewCell. Based on the type of cell you want to display different view cell.
There is a nice tutorial on Xamarin doc, you can read at https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/templates/data-templates/selector
Read this one after that (this is a example for Chat App using ViewCell) https://blog.xamarin.com/customizing-list-view-cells-xamarin-forms-datatemplateselector/
Let me know if you need any specific help after reading that.
I may be missing something here so I apologise if this question may come across as obvious.
In a XAML WinRT app, I can have a GridView control that I can throw a collection of stuff at, and then using DataTemplates etc I can render that stuff on screen.
How can I take this a step further and have a single “master” GridView control which contains several sections which get their data from different places and exist within the app as different collections of stuff?
For example, take the built in Games app. Here we have different sections – Spotlight, Friends, Game Activity etc which are all very different from each other, have different data and are displayed in different ways but they all exist within the same GridView control.
How can this be done?
I do hope this makes sense
Kris
If I understand your requirement correctly, you want to have a group of groups, and display each of the child groups using different templates.
The way I did it was to derive all the child items from a common base class (or you could build a group of groups of Objects, I suppose). Then we used the DataTemplateSelector to pick the appropriate template for each item in the master GridView.
We had to go a step or two further than that in practice, but that's the theory behind how I achieved a similar goal.
I am trying to create a tabbed property view as per given article : The Eclipse Tabbed Properties View
As per article, org.eclipse.ui.views.properties.tabbed.propertyTabs extension point can be used to add new tabs.
<extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
<propertyTabs contributorId="mview.views.SampleView">
<propertyTab
category="sample"
id="mview.ButtonTab"
label="Button"/>
<propertyTab
afterTab="mview.ButtonTab"
category="sample"
id="mview.AdvancedTab"
label="Advanced"/>
</propertyTabs>
</extension>
However in my case the tabs of property view vary depending on the item selected in view. So I have to add the tabs dynamically into extension depening on the item selected.
Please suggest how to do so.
Update:
One of the way to do so (I am not sure if its adviced) is using IExtensionRegistry.addContribution() method. Here I provided an inputstream object containing desired extension details. This added tabs to property view at run time. However with change in selection of item in list viewer, the property view is not updated. Please suggest if this is the right approach to do so.
Ok, I got the solution Its a two step process. Using this one can dyanamically add tabs (and their sections):
Step 1: Associate a tab descriptor provider with the view.
Add an extension point - org.eclipse.ui.views.properties.tabbed.propertyContributor to the view (if not already added). In the propertyContributor section, add a class for tabDescriptorProvider item. This class will implement ITabDescriptorProvider interface.
Step 2: Provide Tabs and Sections:
TabDescriptor provider will return array of TabDescriptors when its getTabDescriptor() method is called. Each TabDescriptor return a list of SectionDecriptors and each SectionDescriptor is linked to a Section. Finally it is the Section class that contains widgets to be displayed on screen. Each widget in Section class has a modify listner which updates the properties of selected items.
While the answer from Viral may not match the specific needs of the OP, the provided answer is likely acceptable to many.
If a tab does not have any sections to display, the default TabbedPropertySheetPage will not show that tab. Thus, if the problem domain is specified in terms of IFilter implementing classes, "dynamic" tabs may be achieved.
Tabs will be added or be removed as the selection changes depending upon whether any sections are present. A visible tab may have one or more sections present on it, and the number of sections on a visible tab may change from selection to selection.
As I came across this page with the same basic issue, I was a bit disappointed that I would need to intervene in the way the OP suggested. After some experimentation, I was able to achieve what I needed purely through the IFilter approach as suggested by Viral.
A tutorial is provided at http://www.eclipse.org/articles/Article-Tabbed-Properties/tabbed_properties_view.html
You need to define a new YourPropertySection derived fromAbstract PropertySection . Also define a filter derived from IFilter and override the select method to return true only for the desired type of selection. Then in plugin.xml write an extension point which would map your PropertySection to the required PropertyTab and will also associate your filter. So this section & tab will only show when your filter returns true.
Currently, when I contribute property pages to Eclipse using the org.eclipse.ui.propertyPages extension point, the individual property pages show up in the property dialog in alphabetical order based on the pages name.
Is there a way to control the order that property pages are listed? I want the basic property page to always show up first, with less important page after it.
I've tried changing the id of the page, but it doesn't appear to have any effect.
Any suggestions?
FWIW: It looks like base eclipse can do it ... in the contributePropertyPage method of RegistryPageContributor, it sets the priority of the PropertyPageNode to -1 if the property page id is "org.eclipse.ui.propertypages.info.file". This is exactly what I want to do.
Figured it out!
What I needed to do is provide my own ContributionComparator in my WorkbenchAdvisor class.
The ContributionComparator has a compare method that allows me to determine the sort order of items in the property page list.
Found the information here.
You could make the less important page a sub-property page of the basic property page.
You could use a hide / show method to put all the properties on the same page.