Example #1
0
        public DDE()
        {
            InitializeComponent();

            var navigationPage = Application.Current.MainPage as NavigationPage;

            navigationPage.BarBackgroundColor = Color.FromHex("#43AEE7");
            NavigationPage.SetBackButtonTitle(this, "Back");
            BarBackgroundColor = Color.White;

            var item = new ToolbarItem
            {
                Icon = "topsearch.png"
            };

            //.ToolbarItems.Add(item);

            ToolbarItems.Add(item);

            item.Clicked += (object sender, EventArgs e) =>
            {
                //StacksearchRef.IsVisible = true;
                Navigation.PushAsync(new SearchByCategoryPage());
            };
            PolicyDataModel pdm = new PolicyDataModel();

            ItemsSource = pdm.All;

            if (App.Current.Properties.ContainsKey("cName"))
            {
                this.Title = App.Current.Properties["cName"].ToString();
            }
            //this.BarBackgroundColor = Color.FromHex("#43AEE7");
            //this.BarTextColor = Color.White;


            //NavigationPage.BarBackgroundColorProperty = Color.FromHex("#111111");



            //SearchFactory sf = new SearchFactory();
            //List<Policies> pl=sf.GetSearchResults("","oil");
        }
Example #2
0
        public DDENew()
        {
            InitializeComponent();

            PolicyDataModel pdm   = new PolicyDataModel();
            var             count = pdm.All;

            switch (pdm.All.Count)
            {
            case 1:
                this.Children.Add(new FirstPage(pdm.All[0])
                {
                    Title = pdm.All[0].Name, Icon = pdm.All[0].Name
                });
                break;

            case 2:
                this.Children.Add(new FirstPage(pdm.All[0])
                {
                    Title = pdm.All[0].Name, Icon = pdm.All[0].Name
                });
                this.Children.Add(new SecondPage(pdm.All[1])
                {
                    Title = pdm.All[1].Name, Icon = pdm.All[1].Name
                });
                break;

            case 3:
                this.Children.Add(new FirstPage(pdm.All[0])
                {
                    Title = pdm.All[0].Name, Icon = pdm.All[0].Name
                });
                this.Children.Add(new SecondPage(pdm.All[1])
                {
                    Title = pdm.All[1].Name, Icon = pdm.All[1].Name
                });
                this.Children.Add(new ThirdPage(pdm.All[2])
                {
                    Title = pdm.All[2].Name, Icon = pdm.All[2].Name
                });
                break;

            case 4:
                this.Children.Add(new FirstPage(pdm.All[0])
                {
                    Title = pdm.All[0].Name, Icon = pdm.All[0].Name
                });
                this.Children.Add(new SecondPage(pdm.All[1])
                {
                    Title = pdm.All[1].Name, Icon = pdm.All[1].Name
                });
                this.Children.Add(new ThirdPage(pdm.All[2])
                {
                    Title = pdm.All[2].Name, Icon = pdm.All[2].Name
                });
                this.Children.Add(new ThirdPage(pdm.All[3])
                {
                    Title = pdm.All[3].Name, Icon = pdm.All[3].Name
                });
                break;

            default:
                break;
            }
        }