How to show nested items in list view - windows-runtime

I'm working in WinRT application, I have list of folders with nested child folders. I need to show it like Windows 8.1 Mail application folders. Refer windows 8.1 Mail. Parent folders and sub folders displayed like this
Fodler1
..Child1
..Child2
..Child 2A
Folder2
..Child1
..Child2
I need to display like this using Listview or List box, Any idea?

Use an ItemTemplateSelector and flatten your folder tree into a list where items have templates that match the folder nesting levels. Make it so that when the folder items get clicked - their children get removed/inserted into the collection (make sure to use ObservableCollection to support monitoring changes to the list).
There's a sample in WinRT XAML Toolkit.
View
View model

Related

How to navigate from a presentational component using react-router?

I'm working on a personal project, it's a simple blog app using ReactJS. I have 1 screen for the entry list page, and 1 for the entry details page.
Now, I'm trying to follow the best practices, so I laid out my components as this:
Entry List Container: container component. Handles fetching entries retrieval and updating application state by dispatching redux actions.
Entry List: presentational component. Receives an Array of Entry objects and shows a list of them
Entry Details Container: container component. Handles more application state update logic, fetching, etc. Receives an Entry object
Entry Details: presentational component. Displays the entry.
Basically both containers renders their presentational counterpart.
Now, the problem is the navigation. In my App component I'm rendering a couple of Route components, one is rendering the EntryListContainer, and another one should render the EntryDetailContainer.
Problem is, how do I navigate from EntryList ?
My hierarchy is something like this:
EntryListContainer
EntryList
EntryRow -----> This contains a button to navigate.
EntryDetailsContainer
EntryPage
I suppose I could render a Link inside EntryRow, something like
<Link to={`${match.url}/{entry.id}`} />
But then I'd have to pass down the match object down from EntryListContainer to EntryList to `EntryRow, and it feels smelly.
How do I navigate properly?

Reusable HTML Blocks in Sitecore

I'm looking for a way to create a reusable HTML widget for a website run on Sitecore 8. My original idea was to create a data template that basically consisted of a single Rich Textbox. The idea is that you could drop any number of instances of these widgets on a placeholder and it would render out the HTML from each instance of the widget on the page and in the correct placeholder.
Example:
A content item called /products/my-product is based off of "Product" data template
It consists of some fields on the Product template (maybe product name, price)
I'd like the ability for the content editor to quickly drop one or more instances of the HTML widget on the page (say, in the right rail or in a different placeholder on the sublayout. I know I could just throw a "notes" field on the product template, but I'd like to make it more dynamic so that they can add several instances of this HTML widget and place them anywhere they desire.
I quickly realized that because we need the ability for multiple instances of this widget, a data template was not enough because each instance of the widget would needs its own data to populate on the front. Thus, my idea was to allow the content editor to add HTML widgets as a child of the current item (so each item would have its own instance data). I don't think this will work because I don't know of a way to have these children tell the parent page which placeholder to put them in, so laying them out is a problem.
I also thought about somehow setting the placeholder name as a parameter or field on the data template for the HTML widget, but I couldn't figure out how to get Sitecore to dynamically add them to a placeholder when it glues everything together.
Is there a way to achieve what I'm trying to do? Seems like a reusable HTML (or other kind of widget, for that matter) would be a fairly common need. I feel like there's an easy Sitecore way to handle this that I'm missing and overcomplicating the solution.
From what I understand, you're looking for Datasource field of a component.
Basically you:
Create a data template which contains fields necessary for your component
Create a set of items using that templates
Allow authors to select one of them as the Datasource for your component.
It's built in Sitecore functionality.
Check blog post http://firebreaksice.com/using-the-datasource-field-with-sitecore-sublayouts/ or google for Sitecore datasource.
Other links:
http://www.nonlinearcreations.com/Digital/how-we-think/articles/2014/03/4-patterns-Sitecore-component-development.aspx
http://www.nonlinearcreations.com/Digital/how-we-think/articles/2015/04/Sitecore-templates.aspx
EDIT:
Read about Datasource Location field (defining the repository of datasources location) here: http://www.sitecore.net/learn/blogs/technical-blogs/getting-to-know-sitecore/posts/2011/01/handling-presentation-component-settings.aspx
Read about Datasources and MVC here: http://jockstothecore.com/sitecore-mvc-item-maze/

Windows Phone 8 expandable list view

I need to implement expandable list view on windows phone 8. My target is to bind the values from JSON output which i receive as parent child format.
I'm assuming you are wanting something similar to Androids ExpandableListView?
If so, then take a look at Windows Phone Toolkits ExpanderView
The WPToolkit has a pretty awesome ExpanderView control. Check it out
http://www.geekchamp.com/articles/windows-phone-toolkit-expanderview-in-depth-part1-key-concepts-and-api
If you want to make a custom solution, in your datatemplate add a grid whose visibility is bound to your model property and on ListBox SelectionChanged, toggle the value of that property

Windows PhoneToolkit ListPicker: implementing a countries list as in the settings?

I have a list of countries that I want to display in a list similar to that in the phone settings app
I tried using the toolkit's ListPicker but it had a poor performance in loading as the list size is large, it seems that this is a known issue with ListPicker.
is there any alternatives to implementing such a list ?
I know this is an old question, but here's the solution that worked for me:
Implement a new page with a ListBox.
In the new page, when an item is selected, save the selected Item/Index in the PhoneApplicationService.Current.State
Then navigate backwards and retrieve the saved Item/Index from the page state.

File import with interface similar to Windows Explorer in Access 2007

I would like the user to import the files into my Access VBA, I wonder if I can make the interface to be a bit like Windows Explorer:
With the window split into 2 halves, user can highlight the directory on the left half, and then the right half will show the files inside (even better if it can filter the file with specific extension), the use can select the files by clicking the checker box.
Is it possible in Access 2007 VBA, I don't want to reinvent the wheel again.
Thanks.
Have a look at
How to: Display and Use the File Dialog Box
Nothing built in as far as I know so that leaves rolling you own. If it was me doing it I would be doing something like this
Treeview control on the left
Listview control on the right
Two buttons in the middle one to add one to remove
The Treeview would be populated with the file structure of the machine (links at the end on how to do this)
When the user clicks on the add button it adds the full path and the file name to the listview in separate columns.
A bit of a pain but not that hard once you break it down
Link to how to get file info in VBA
http://www.everythingaccess.com/tutorials.asp?ID=List-files-recursively