SemanticZoom in Okra

Jul 14, 2013 at 1:53 PM
I'm new to Okra, but I'm already enjoying the framework. Great work!
I have a question, that I hope someone can answer:
I'm trying to change my grouped GridView to a SemanticZoom. What is the best method to do that? The samples I was able to find change the collectionview in OnNavigatedTo handler, which doesn't appear to be called.
Any ideas?

Thanks!
Jul 14, 2013 at 2:19 PM
Never mind. I figured out what the problem was: the ItemsSource in the ZoomedOut view was bound incorrectly. It's working fine now.

Kind regards.
Coordinator
Jul 16, 2013 at 8:38 PM
Hi,

I'm pleased that you managed to sort out the issue with binding to the SemanticZoom control. As you mentioned all the samples provided by Microsoft perform this binding in code via the OnNavigatedTo handler (NB: If you really need it Okra provides an INavigationAware interface that you can add to views or view-models to get OnNavigatedTo(...) style method calls). I have heard comments that it is not possible to bind the SemanticZoom control via data-binding alone, but as you have found it does seem possible if you get the data-binding right.

I'll try to put together a sample around this to aid anyone else in the future that comes across this issue.

Regards,
Andy
Jul 16, 2013 at 8:56 PM
Hi Andy,

Thanks for your reply.
I'm sure that sample will help a lot of people.
The only thing still in the code-behind is the handler for zooming back in and making sure the zoom-in view is in view:
    private void SemanticZoom_OnViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
    {
        if (!e.IsSourceZoomedInView)
        {
            e.DestinationItem.Item = e.SourceItem.Item;
        }
    }
It's not a big issue though. It can probably moved of to the modelview by an event-to-command routing mechanism, but probably that's overkill.

Kind regards,

Geri