在windows phone应用程序中自定义全局类保存应用信息

在App.xmal.cs中

        public class GlableInfo
        {
            // 友盟统计KEY
            private string umengKey = "";
            // winphone升级参数
            private string winphoneVersion = "";

            private string appName = "";

            private string appTel = "";

            private string appCompanyName = "";

            private string appWeb = "";

            private string appEmail = "";

            private string appQQ = "";

            public string UmengKey
            {
                get
                {
                    return umengKey;
                }
                set
                {
                    umengKey = value;
                }
            }

            public string WinPhoneVersion
            {
                get
                {
                    return winphoneVersion;
                }
                set
                {
                    winphoneVersion = value;
                }
            }

            public string AppName
            {
                get
                {
                    return appName;
                }
                set
                {
                    appName = value;
                }
            }

            public string AppTel
            {
                get
                {
                    return appTel;
                }
                set
                {
                    appTel = value;
                }
            }
            public string AppCompanyName
            {
                get
                {
                    return appCompanyName;
                }
                set
                {
                    appCompanyName = value;
                }
            }
            public string AppWeb
            {
                get
                {
                    return appWeb;
                }
                set
                {
                    appWeb = value;
                }
            }
            public string AppEmail
            {
                get
                {
                    return appEmail;
                }
                set
                {
                    appEmail = value;
                }
            }
            public string AppQQ
            {
                get
                {
                    return appQQ;
                }
                set
                {
                    appQQ = value;
                }
            }
        }

在MainPage.xmal.cs中调用

    public partial class MainPage : PhoneApplicationPage
    {
        public static App.GlableInfo info = new App.GlableInfo();
        string localVer = info.WinPhoneVersion;


你可能感兴趣的:(静态类,WinPhone,全局类)