Exemplo n.º 1
0
        public WelcomePage()
        {
            InitializeComponent();
            Resources = Application.Current.Resources;

            RTLSwapHelper.UpdateItem(btnToggleRTL);
            btnToggleRTL.Command = new Command(v => RTLSwapHelper.HandleMirrorClicked(btnToggleRTL));
        }
Exemplo n.º 2
0
        public NewsDetailPage()
        {
            InitializeComponent();
            Resources      = Application.Current.Resources;
            BindingContext = new ArticleViewModel();

            RTLSwapHelper.UpdateItem(btnToggleRTL);
            btnToggleRTL.Command = new Command(v => RTLSwapHelper.HandleMirrorClicked(btnToggleRTL));
        }
Exemplo n.º 3
0
        public OfferCategoryListPage()
        {
            InitializeComponent();
            Resources = Application.Current.Resources;

            BindingContext = SamplesDefinition.SamplesCategories.Values;

            RTLSwapHelper.UpdateItem(btnToggleRTL);
            btnToggleRTL.Command = new Command(v => RTLSwapHelper.HandleMirrorClicked(btnToggleRTL));
        }
        public MainPage()
        {
            InitializeComponent();
            Resources = Application.Current.Resources;

            RTLSwapHelper.UpdateItem(btnToggleRTL);
            btnToggleRTL.Command = new Command(v => RTLSwapHelper.HandleMirrorClicked(btnToggleRTL));

            btnRequestFormPage.Command       = new Command((v) => OnRequestFormPageClicked(this, null));
            btnRequestThemePage.Command      = new Command((v) => OnRequestThemePageClicked(this, null));
            btnRequestWelcomePage.Command    = new Command((v) => OnRequestWelcomePageClicked(this, null));
            btnRequestNewsListPage.Command   = new Command((v) => OnRequestNewsListPageClicked(this, null));
            btnRequestNewsDetailPage.Command = new Command((v) => OnRequestNewsDetailPageClicked(this, null));
            btnOfferCategoryListPage.Command = new Command((v) => OnRequestOfferCategoryListPageClicked(this, null));
        }
        public NewsListPage()
        {
            InitializeComponent();
            Resources = Application.Current.Resources;

            //BindingContext = new PostsViewModel();
            _listOfItems    = new ObservableCollection <News>();
            _listOfItems_en = new ObservableCollection <News>();

            getNews();

            RTLSwapHelper.UpdateItem(btnToggleRTL);
            btnToggleRTL.Command = new Command(v => RTLSwapHelper.HandleMirrorClicked(btnToggleRTL));

            btnToggleRTL.Clicked += (sender, e) =>
            {
                if (language == "en")
                {
                    newsListview.ItemsSource = _listOfItems;
                    language = "ar";
                }
                else
                {
                    newsListview.ItemsSource = _listOfItems_en;
                    language = "en";
                }
            };

            newsListview.ItemAppearing += (sender, e) =>
            {
                if (isLoading || _listOfItems.Count == 0)
                {
                    return;
                }

                if (e.Item == _listOfItems[_listOfItems.Count - 1] || e.Item == _listOfItems_en[_listOfItems.Count - 1])
                {
                    page_num++;
                    getNews();
                }
            };
        }