Click here to Skip to main content
15,885,757 members
Articles / Desktop Programming / WPF

Run Windows Store Apps From Desktop

Rate me:
Please Sign up or sign in to vote.
4.92/5 (9 votes)
25 Mar 2013CPOL3 min read 53.3K   988   30  
How to work with Windows Store apps from a Desktop application - Run, Get App State, Stop, and more.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;

namespace SR_WindowsAppPlayGround
{
    public class StatusToColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                var status = value.ToString();
                switch (status)
                {
                    case "RUNNING": return new SolidColorBrush(Colors.Green);
                    case "SUSPENDED": return new SolidColorBrush(Colors.Orange);
                    case "TERMINATED": return new SolidColorBrush(Colors.Red);
                    case "SUSPENDING": return new SolidColorBrush(Colors.RosyBrown);
                    default: return new SolidColorBrush(Colors.DarkGray);

                }
            }
            return new SolidColorBrush(Colors.DarkGray);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Sela
Israel Israel
Shai Raiten is VS ALM MVP, currently working for Sela Group as a ALM senior consultant and trainer specializes in Microsoft technologies especially Team System and .NET technology. He is currently consulting in various enterprises in Israel, planning and analysis Load and performance problems using Team System, building Team System customizations and adjusts ALM processes for enterprises. Shai is known as one of the top Team System experts in Israel. He conducts lectures and workshops for developers\QA and enterprises who want to specialize in Team System.

My Blog: http://blogs.microsoft.co.il/blogs/shair/

Comments and Discussions