protected override void OnCreate()
 {
     base.OnCreate();
     ThemeLoader.Initialize(DirectoryInfo.Resource);
     NativeParent = MainWindow;
     LoadApplication(new App());
 }
示例#2
0
        public static void Init(InitOptions options)
        {
            var resPath = options.Context?.DirectoryInfo?.Resource;

            if (!string.IsNullOrEmpty(resPath))
            {
                ThemeLoader.Initialize(resPath);
            }

            Init(options.GoogleMapsAPIKey);
        }
示例#3
0
        public static void Init(CoreApplication context)
        {
            var resPath = context?.DirectoryInfo?.Resource;

            if (!string.IsNullOrEmpty(resPath))
            {
                ThemeLoader.Initialize(resPath);
            }

            Init();
        }
示例#4
0
        /// <summary>
        /// Init with options
        /// </summary>
        /// <param name="options"></param>
        public static void Init(InitOptions options)
        {
            var resPath = options.Context?.DirectoryInfo?.Resource;

            if (!string.IsNullOrEmpty(resPath))
            {
                ThemeLoader.Initialize(resPath);
            }

            MainWindowProvider = options.MainWindowProvider;
            Init();
        }
示例#5
0
        void Initialize()
        {
            ResourceDir = DirectoryInfo.Resource;
            MaterialGallery.ResourceDir = DirectoryInfo.Resource;
            ThemeLoader.Initialize(ResourceDir);

            _window = new Window("WatchMaterialGallery")
            {
                AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90
            };
            _window.BackButtonPressed += (s, e) =>
            {
                Exit();
            };
            _window.Show();

            _screenWidth = _window.ScreenSize.Width;
            CreateTestPage(_window);
        }
        void Initialize()
        {
            ResourceDir = DirectoryInfo.Resource;
            ThemeLoader.Initialize(ResourceDir);

            _mainWindow = new Window("MaterialGallery");
            _mainWindow.Show();
            _mainWindow.BackButtonPressed += (s, e) =>
            {
                UIExit();
            };

            var conformant = new Conformant(_mainWindow);

            conformant.Show();

            var box = new Box(_mainWindow)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };

            box.Show();

            var bg = new Background(_mainWindow)
            {
                Color = Color.White
            };

            bg.SetContent(box);
            conformant.SetContent(bg);

            GenList list = new GenList(_mainWindow)
            {
                Homogeneous = true,
                AlignmentX  = -1,
                AlignmentY  = -1,
                WeightX     = 1,
                WeightY     = 1
            };

            GenItemClass defaultClass = new GenItemClass("default")
            {
                GetTextHandler = (data, part) =>
                {
                    BaseGalleryPage page = data as BaseGalleryPage;
                    return(page == null ? "" : page.Name);
                }
            };

            foreach (var page in GetGalleryPage())
            {
                if (Elementary.GetProfile() == "tv" && page.ExceptProfile == ProfileType.TV)
                {
                    continue;
                }
                list.Append(defaultClass, page);
            }

            if (ThemeLoader.Profile == TargetProfile.Wearable)
            {
                list.Prepend(defaultClass, null);
                list.Append(defaultClass, null);
            }

            list.ItemSelected += (s, e) =>
            {
                BaseGalleryPage page = e.Item.Data as BaseGalleryPage;
                RunGalleryPage(page);
            };
            list.Show();
            box.PackEnd(list);
        }