void LauncherWindowCommandPinnedToTaskbar(object sender, UICommandEventArgs e)
 {
     var datacontext = DataContext as MainPageViewModel;
     Config.IsolatedStorage.PinnedCommands[e.Command.Id] = true;
     if (!datacontext.TaskbarCommands.Contains(e.Command))
     {
         datacontext.TaskbarCommands.Add(e.Command);
     }
 }
        void command_AfterShow(object sender, UICommandEventArgs e)
        {
            var datacontext = DataContext as MainPageViewModel;
            var command = sender as UICommand;

            if (command != null)
            {
                IncrementScore(command);

                if (command.View != null)
                {
                    if (command.HasAttribute<IsModalAttribute>())
                    {
                        var modalWindow = new ModalWindow(command,
                                                          command.GetAttribute<IsModalAttribute>().HasCloseButton);
                        modalWindow.Show();
                        modalWindow.Closed += modalWindow_Closed;
                    }
                    else if (command.HasAttribute<AttachToTrayAttribute>())
                    {
                        if (!datacontext.TrayCommands.Contains(command))
                        {
                            datacontext.TrayCommands.Add(command);
                        }
                        else
                        {
                            var trayWindow = new TrayWindow(command.View, command.Name);
                            trayWindow.Show();
                        }
                    }
                    else
                    {
                        datacontext.CommandInFocus = command;

                        if (!datacontext.TaskbarCommands.Contains(command))
                        {
                            datacontext.TaskbarCommands.Add(command);
                        }
                    }
                }
            }
        }