Windows Phone 7 Navigation Issue “InvalidOperationException” or “No Fragment support”

Several days ago I have received an interesting question for my Windows Phone 7 Application Bar article, where one of my readers has described an exception (InvalidOperationException, “No Fragment support right now”) occurred after the illegal navigation attempt(using Application Bar in App.xaml). Fortunately, I’ve managed to reproduce this issue and, in my opinion, it was caused by the wrong URI. It seems that URI of destination page was to the same as URI of current page in RootFrame and this kind of navigation is not supported.

To prevent this exception from occurring use the lines of code bellow. Same check can be used for the NavigationService.Navigate method.

private void ApplicationBarIconButton_Click(object sender, EventArgs e)
{
    Uri navigateUri = new Uri("/PassingParameters/Page1.xaml", UriKind.Relative);
    if (RootFrame.CurrentSource != navigateUri)
    {
        RootFrame.Navigate(navigateUri);
    }
}


Posted in Development, Navigation, Tips & Tricks, Windows Phone 7 | Tagged , , , | 1 Comment

Passing values between Windows Phone 7 pages: Destination page instance within OnNavigatedFrom method

Another appropriate way for passing data from one page to another during the navigation is in setting up destination page properties (or variables) within OnNavigatedFrom method of source page.

passing data or parameters from one page to another using onnavigatedfrom method and destination page instance by eugenedotnet

Continue reading

Posted in Development, Navigation, Tutorials, Windows Phone 7 | Tagged , , , | 1 Comment

Passing values to Windows Phone 7 pages: URI paremeters and QueryString

From my point of view specifying parameters and their values in URI (QueryString) is probably the easiest way to pass data from one page to another during the Navigation. In this post I am going to cover this approach for passing values to pages and in future posts I am going to explain few other ways.

eugenedotnet passing values to windows phone 7 pages during navigation
Continue reading

Posted in Development, Navigation, Silverlight, Tutorials, Windows Phone 7 | Tagged , , , , | 3 Comments

Baltic MVP Summit 2011

Few weeks ago I’ve been invited to participate in Baltic MVP Summit 2011 and now it is the right time to write my feedback about that event. First of all, I would like to say that it was my first event fully supported by Microsoft that I participated in, so THANK YOU Microsoft for inviting me, it was a real pleasure. I must admit that we have a really great and friendly community in our Baltic countries.

Jevgeni Tšaikin aka eugenedotnet at baltic mvp summit 2011 group photo
Continue reading

Posted in Events, MVP | Tagged , , , , , | 1 Comment

Creating a Horizontal ListBox in Silverlight and Windows Phone

Creating horizontal ListBox element is obviously a pretty easy thing to do, but anyway I have decided to post XAML for that.

<ListBox ScrollViewer.HorizontalScrollBarVisibility="Auto">
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal" />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
    <ListBox.ItemTemplate>
        <DataTemplate>
           <Your control... />
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>


Posted in Development, Silverlight, Tips & Tricks, Windows Phone 7 | Tagged , , | 3 Comments

W18: Difference between GoBack method and Navigate method of NavigationService in Windows Phone 7

Recently I have noticed that not many Windows Phone 7 developers know the difference between NavigationService.GoBack() method and NavigationService.Navigate(..Uri..) method (in case it leads to the previous page). I will explain the main difference in this tutorial.

Continue reading

Posted in Development, Navigation, Tutorials, Windows Phone 7 | Tagged , , , | 4 Comments

W17: Windows Phone 7 System Tray

System Tray is an important part of Windows Phone 7 platform as it displays critical system information and notifications to the user. In this post I will cover basic functionality of system tray, explain how to hide/show system tray in your Windows Phone 7 applications programmatically and demonstrate some status icons.

eugenedotnet system tray tutorial for windows phone 7

Continue reading

Posted in System Tray, Windows Phone 7 | Tagged , , , | 3 Comments

W16: Detecting and handling multi-touch events in Windows Phone 7 applications

In this tutorial I am going to describe a very simple application I’ve developed while playing around with multi-touch functionality in Windows Phone 7. Application is going to detect and handle multi-touch event for 4 touch points simultaneously. Image bellow shows application is action.

eugenedotnet multi-touch for windows phone 7 tutorial

Continue reading

Posted in Development, Multi-touch, Tutorials, Windows Phone 7 | Tagged , , , | 9 Comments

W15: Displaying Subtitles using Timeline Markers in Windows Phone 7 media applications

In this tutorial I will show my custom implementation of subtitles using Timeline Markers. Timeline Markers are usually used with SmoothStreamingMediaElement, but in my tutorial I am going to use TimelineMarker and TimelineMarkerCollection classes for my custom Media Player control.

eugenedotnet subtitles for media element using timeline markers
Continue reading

Posted in Development, Media, Windows Phone 7 | Tagged , , , | 2 Comments

W14: Multi-column StackPanel for Windows Phone 7

Few days ago I have decided to develop multi-column StackPanel control for one of my projects. Basically, I have created many StackPanels in horizontal orientation inside a StackPanel with vertical orientation. It should be a very simple solution and I am going to share it with you in this post. Same solution could be applied to other Silverlight applications.

eugenedotnet multi column stackpanel for Windows Phone 7

Continue reading

Posted in Custom Controls, Development, Silverlight, Tutorials, Windows Phone 7 | Tagged , , , , | 4 Comments