Exemple #1
0
        protected DemoBase()
        {
            var attrs = GetType().GetCustomAttributes(typeof(DemoAttribute), false);

            if (attrs.Length > 0)
            {
                var demoAttr = attrs[0] as DemoAttribute;
                Metadata = new DemoMetadata(
                    demoAttr.Id,
                    demoAttr.Order,
                    demoAttr.Title);
            }
        }
Exemple #2
0
        public MainPage()
        {
            InitializeComponent();

            m_sampleList.ItemsSource = DemoMetadata.GetDemos(typeof(MainPage).Assembly, "Introduction");

            m_contentFrame.Navigating += (sender, e) =>
            {
                if (e.Uri != null)
                {
                    var uri = e.Uri.ToString();
                    if (uri.StartsWith("http://"))
                    {
                        Process.Start(uri);
                        e.Cancel = true;
                    }
                }
            };
        }