create a user control Treeview in metro - xaml

There's no treeview control in win rt, anyone know how to create a treeview user control? Any control should I inheritant?

Navigation by hierarchical structure is better visualize with ListView in winrt. You need to display a list of nodes, when user touches a node, it should display ListView with sub nodes and button back.
But you can implement own control TreeView (that looks like WPF or Silverlight TreeView). You need to derive from ListBox and ListBoxItem controls, and add indent for subnodes at PrepareContainerForItemOverride() method.

Related

Button control as ListView DataTemplate container wrt Drag-and-Drop of ListView Elements

When I use a Button control in DataTemplate for ListView (UWP app), Drag-and-Drop of ListView items doesn't work. If I use containers like StackPanel, RelativePanel or Grid, instead of Button control, everything works fine. I would prefer the Button control as a container, because I like its mouse Hover effect on ListView items. I can do something similar for StackPanel, etc, with a custom hover effect by using a combination of Style and Behavior programming but trying to avoid this route (too involved).
Can I do something to the Button control so that it gives me the hover and also responds to the Drag-and-Drop event when part of a ListView DataTemplate?
I am also curious what specifically makes the Button suppress the Drag-and-Drop of ListView items.
The Button is capturing the pointer which cause the pointer click event not be bubble up to the ListViewItem which cause the Drag&Drop to start.
You can take a look at ReleasePointerCapture method which will release the pointer capture allowing other item to capture it.
You will need to create a new class which extends the default Button class and override for example the OnPointerPressed method to choose the logic between the drag&drop and the click on the button.

SemanticZoom without GridView

I'd like to know, how I can implement my own SemanticZoom WITHOUT GridView control.
I have my own custom controls on the mainpage but a structure similar to a grouped GridView and I want to open details after the user makes a zoom-gesture on a group.
But it seems that the SemanticZoom control only works together with the GridView.
Any ideas?
cheers, Thomas
The controls contained inside the SemanticZoom control can be any control that implements the ISemanticZoomInformation interface - ISemanticZoomInformation interface
Simple example at Semantic Zoom only supports GridView and ListView?

Detecting a scroll event in GridView (Windows 8)

How do we detect a scrolling event in GridView (like ViewChanged on ScrollViewer) on somethig like the default GridView template sample app? I'd like to replicate the effect that the netflix App does on the left red strip.
I tried putting the GridView inside a scrollviewer, but I've been unsuccessful at stretching it to fill the screen for different resolutions.
Update: I intend to use this with VariableGrid control that's on NuGet - though it's not an official control, it inherits GridView
The best way to do this seems that you can read through the components of the control, and assign events to it. based on what's happening in this example
http://mikaelkoskinen.net/post/WinRT-XAML-Automatically-Scrolling-ListView-to-Bottom-and-Detecting-When-ListView-is-Scrolled.aspx
I grabbed access to the scrollbar, suing the VisualTreeExtensions and I could capture the event Scroll, just like in the example. I had to read the children when the Loaded event of the grid was fired.
There is a simpler way.
Edit a template of the GridView, and look inside the XAML to find a ScrollViewer which is a component of the GridView.
The ScrollViewer has a ViewChanged event that you can subscribe to. Now whenever the GridView is scrolled, this event will be fired.
Try ManipulationCompleted and PointerReleased events on GridView. This is just using keyboard mouse..

C#/XAML Store App: accessing controls in FlipView.ItemTemplate

I've got a Flipview which has an ItemTemplate which contains a MediaElement and buttons for pause and play. I need to be able to access the MediaElement based on the Clicked event on the buttons. What is the best way to link my buttons to my MediaElement? Most of the code examples I find on the internet apply to WPF and not Store Apps. Ideally, I'd like to be able to use CommandParameters or some other type of XAML binding to pass the MediaElement control back to the event handler. Thanks
Put your MediaElement and buttons in a separate UserControl and put that control in your ItemTemplate. After that - it should be easy.

vb.net scrollable content panel

Is there a control in vb.net that is specifically designed for displaying content larger than the control itself?
I know it's possible to code your own using a panel and two scrollbars, but is there an already existing method for this?
Thanks for your help
All control containers, such as Panel, FlowLayoutPanel etc. have AutoScroll property, which does what you want.