コード例 #1
0
        public NewsPage()
        {
            Binding = new NewsViewModel(ConfigurationManager.RemoteResources.Local.News, ConfigurationManager.RemoteResources.Remote.News);

            InitializeComponent();
            BindingContext = Binding;

            ElementsController.RenderScannerIcon(ApplicationLayoutTopLevel, Navigation);

            ElementsController.RenderNotification(ApplicationLayoutTopLevel, AppResources.AppResources.NotificationNoInternet, "lost-connection-notification", "_VMIsDeviceOfflineNotification", true);
            ElementsController.RenderNotification(ApplicationLayoutTopLevel, AppResources.AppResources.NotificationOutdatedContent, "cached-content-notification", "_VMIsContentOutdatedNotification", false);

            Binding.InitializeService();

            NewsList.RefreshCommand = new Command(() =>
            {
                Binding.InitializeService();
                NewsList.EndRefresh();
            });
        }