Winrt Syncfusion TileView control selectionChanged event not firing - windows-8

I am working on a win8 app using Syncfusion controls. I used a TileView control in a page with 4 hardcoded items in xaml.
I want to capture a event to find out which item is in maximized state or clicked.
I tried selectionchanged event of TileView but that's not firing even tap event of TileViewItem also not firing.
Is there any way?
I tried to use same thing with the sample code. same result.
I found something after editing template
There is no property like IsItemClickEnabled.

I checked Syncfusion TileView Control in latest version 11.2.0.64, SelectionChanged event is firing in TileView when we select item and maximized item was identified through MaximizedItem property of TileView.
Sample :
http://www.syncfusion.com/uploads/user/directTrac/General/TileView_StackOverflow-347277746.zip

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.

StackPanel Transition Event

How can I call StackPanel to do its transition by a button click
Like when you search in the Metro(Start) Menu in Windows 8
I have tried
Panel1.Visibility = Windows.UI.Xaml.Visibility.Visible
But it just changes the visible property and doesn't animate its entrance
Take a look at Windows Runtime transitions. In your case you would need AddDeleteThemeTransition (from MSDN: "Provides the animated transition behavior for when controls add or delete children of a panel")

Silverlight Usercontrol in Datagrid does not fire the CellEditEnded event

I have a UserControl that is displaying in a DataGrid. It contains a DatePicker and a Button that opens a Popup control where the user makes a selection that once selected populates a textblock with the result. The DatePicker is the only object that if changed will set off the CellEditEnded event. How can I get the popup controls selectionChanged event to tell the Datagrid that the cell has done as edit?
Turns out I was putting the UserControl inside the CellTemplate when I needed to put something else in that for display and my UC in the CellEditingTemplate. Now it fires as it should. I missed something simple and I should not have. Hope this helps someone else.

How to trigger a storyboard on a list item when it is tapped and have the page be notified when the animation ends?

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.

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..