I have a GridView in SemanticZoom.ZoomedOutView. When I set the GridViews ItemClick it never gets called. How do I put a custom action to the click? I want to do a slihtly different logic.
(Please do not answer like you should not do this, it is the clients wish and the cannot be persuaded)
I created a custom Grid implementing ISemanticZoomInformation and used it in the ZoomedOutView, the GridView as its child.
I summed it up in a blog post: http://blog.kulman.sk/customizing-semantic-zoom-in-windows-8-apps/
Related
I would like to create a simple wizard based on a TabControl in Avalonia UI with four pages. Each page with a few controls. Instead of the TabItem headers I would like to create my own buttons and hide the default TabItem headers.
There are plenty of solutions for WPF, mostly involving ItemsContainerStyle and the Visibility property, both of which don't seem to be accessible in the Avalonia TabControle.
Is there any way to hide the headers?
Or is there a better way to implement a wizard?
You probably need to use the Carousel class directly. It's used by the TabControl internally for presenting the current item.
See example usage here:
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml - markup
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml.cs - codebehind
I'm porting a Windows Phone 8 app to Windows 8 and I have a scenario where the user taps an item in my list control / grid view and I want to play an "activation" animation on the item, wait for the animation to complete, and then navigate away from the page.
On Windows Phone, I used DataTriggers in one case, and in another I used VisualTreeHelper to iterate through the view and find the VirtualizingStackPanel and then the actual item and then accessed it directly to invoke the storyboard...
Neither appears to work in this case and also seems that DataTriggers are not supported in winrt (DataTrigger in WinRT?).
I'd like to do the right thing here. I've seen suggestions that visual states can be used, but it is not clear how in this case.
Any help much appreciated.
Thanks
There are two ways I would go about this, though neither is particularly pretty.
Method A
Create a custom control that will act as each GridView item and place it in the GridView's ItemTemplate.
<GridView>
<GridView.ItemTemplate>
<DataTemplate>
<mynamespace:MyControl/>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
Then, in MyControl's constructor, attach a handler to the Tapped event, and in that handler you can perform your animation. The animation can be defined in MyControl.xaml. MyControl should also expose an event for when the animation is complete
public event EventHandler SelectedAnimationComplete;
and fire it when your custom storyboard completes. The page hosting the GridView can attach to MyControl's custom event to perform the navigation.
...
<mynamespace:MyControl SelectedAnimationComplete="selectedAnimationComplete"/>
...
Method B
On the GridView, set SelectionMode to None, IsItemClickEnabled to true, and attach a handler to the ItemClick event. Inside the handler, you can use
(sender as GridView).ItemContainerGenerator.ContainerFromItem(e.ClickedItem)
to get the GridViewItem, and then dig down the visual tree with VisualTreeHelper.GetChild. In your ItemTemplate, the root visual (likely a Grid) can have your animation placed in its Resources collection. Dig down the visual tree until you find the ItemTemplate's root grid, get the animation from its Resources collection, attach a completion handler to it, and run it. You can perform your navigation in the completion handler.
And in what conditions should you use one over the other?
The HTML controls intent is to merely show an existing HTML page in place with the goal of merely presenting it. With page control, you can extend it with behaviors, compose it with more page controls and have it work with your navigation model.
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?
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..