public PSProductList(PastryShop pastryShop)
        {
            InitializeComponent();
            this.pastryShop = pastryShop;
            BodyLayout.TranslateTo(0, -50);
            List.SeparatorVisibility = SeparatorVisibility.None;

            addProduct = new ToolbarItem
            {
                Icon     = "plus.png",
                Text     = "Ajouter",
                Order    = ToolbarItemOrder.Primary,
                Priority = 0
            };
            addProduct.Clicked += AddProduct_Clicked;

            filterToolbarItem = new ToolbarItem()
            {
                Text  = "Filtrer",
                Order = ToolbarItemOrder.Secondary,
                Icon  = "filter.png"
            };
            filterToolbarItem.Clicked += FilterToolbarItem_Clicked;

            searchToolbarItem = new ToolbarItem()
            {
                Text  = "Chercher",
                Order = ToolbarItemOrder.Primary,
                Icon  = "search.png"
            };
            searchToolbarItem.Clicked += SearchToolbarItem_Clicked;

            endSearchToolbarItem = new ToolbarItem()
            {
                Text  = "Terminer",
                Order = ToolbarItemOrder.Primary,
                Icon  = "close.png"
            };
            endSearchToolbarItem.Clicked += EndSearchToolbarItem_Clicked;

            sortToolbarItem = new ToolbarItem()
            {
                Text  = "Trier",
                Order = ToolbarItemOrder.Primary,
                Icon  = "sort.png"
            };
            sortToolbarItem.Clicked += SortToolbarItem_Clicked;

            ToolbarItems.Add(addProduct);
            ToolbarItems.Add(searchToolbarItem);
            ToolbarItems.Add(sortToolbarItem);
            ToolbarItems.Add(filterToolbarItem);

            displayedProducts.CollectionChanged += DisplayedProducts_CollectionChanged;
            List.ItemsSource = displayedProducts;
            load(false);
        }
 private void SearchToolbarItem_Clicked(object sender, EventArgs e)
 {
     if (displayedProducts.Count != 0)
     {
         this.ToolbarItems.Clear();
         ToolbarItems.Add(endSearchToolbarItem);
         BodyLayout.TranslateTo(0, 0);
         SearchBar.Focus();
     }
 }
 private async void ResetSearch()
 {
     SearchBar.Text = "";
     SearchBar.Unfocus();
     ToolbarItems.Clear();
     ToolbarItems.Add(searchToolbarItem);
     ToolbarItems.Add(sortToolbarItem);
     ToolbarItems.Add(filterToolbarItem);
     await BodyLayout.TranslateTo(0, -50);
 }
        public PastryShopProductList(PastryShop pastryShop)
        {
            InitializeComponent();
            this.pastryShop = pastryShop;
            BodyLayout.TranslateTo(0, -50);
            List.SeparatorVisibility = SeparatorVisibility.None;

            filterToolbarItem = new ToolbarItem()
            {
                Text  = "Filtrer",
                Order = ToolbarItemOrder.Primary,
                Icon  = "filter.png"
            };
            filterToolbarItem.Clicked += FilterToolbarItem_Clicked;

            searchToolbarItem = new ToolbarItem()
            {
                Text  = "Chercher",
                Order = ToolbarItemOrder.Primary,
                Icon  = "search.png"
            };
            searchToolbarItem.Clicked += SearchToolbarItem_Clicked;

            endSearchToolbarItem = new ToolbarItem()
            {
                Text  = "Terminer",
                Order = ToolbarItemOrder.Primary,
                Icon  = "close.png"
            };
            endSearchToolbarItem.Clicked += EndSearchToolbarItem_Clicked;

            sortToolbarItem = new ToolbarItem()
            {
                Text  = "Trier",
                Order = ToolbarItemOrder.Primary,
                Icon  = "sort.png"
            };
            sortToolbarItem.Clicked += SortToolbarItem_Clicked;

            ToolbarItems.Add(searchToolbarItem);
            ToolbarItems.Add(filterToolbarItem);
            ToolbarItems.Add(sortToolbarItem);

            displayedProducts.CollectionChanged += DisplayedProducts_CollectionChanged;
            List.ItemsSource = displayedProducts;
            pastryShop.Products.OrderBy(p => p.Name).ToList().ForEach(p => displayedProducts.Add(p));
            selectedSortType.SortTypeIndex   = 0;
            selectedSortType.IsAsc           = true;
            selectedPriceRange.MaxPriceRange = maxPriceRange.MaxPriceRange = pastryShop.Products.Max(p => p.Price);
            selectedPriceRange.MinPriceRange = maxPriceRange.MinPriceRange = pastryShop.Products.Min(p => p.Price);
        }
        public UserOrderList()
        {
            InitializeComponent();
            BodyLayout.TranslateTo(0, -50);

            filterToolbarItem = new ToolbarItem()
            {
                Text  = "Filtrer",
                Order = ToolbarItemOrder.Primary,
                Icon  = "filter.png",
            };
            filterToolbarItem.Clicked += FilterToolbarItem_Clicked;

            sortToolbarItem = new ToolbarItem()
            {
                Text  = "Trier",
                Order = ToolbarItemOrder.Primary,
                Icon  = "sort.png"
            };
            sortToolbarItem.Clicked += SortToolbarItem_Clicked;

            searchToolbarItem = new ToolbarItem()
            {
                Text  = "Chercher",
                Order = ToolbarItemOrder.Primary,
                Icon  = "search.png"
            };
            searchToolbarItem.Clicked += SearchToolbarItem_Clicked;

            endSearchToolbarItem = new ToolbarItem()
            {
                Text  = "Terminer",
                Order = ToolbarItemOrder.Primary,
                Icon  = "close.png",
            };
            endSearchToolbarItem.Clicked += EndSearchToolbarItem_Clicked;

            ToolbarItems.Add(searchToolbarItem);
            ToolbarItems.Add(filterToolbarItem);
            ToolbarItems.Add(sortToolbarItem);

            displayedOrders.CollectionChanged += DisplayedProducts_CollectionChanged;
            OrderList.ItemsSource              = displayedOrders;
            load();
        }
Exemple #6
0
        public PastryShopList()
        {
            InitializeComponent();
            BodyLayout.TranslateTo(0, -50);
            List.SeparatorVisibility = SeparatorVisibility.None;
            displayedPastryShops.CollectionChanged += DisplayedPastryShops_CollectionChanged;
            List.ItemsSource = displayedPastryShops;

            filterToolbarItem = new ToolbarItem()
            {
                Text  = "Filtrer",
                Order = ToolbarItemOrder.Primary,
                Icon  = "filter.png"
            };
            filterToolbarItem.Clicked += FilterToolbarItem_Clicked;

            searchToolbarItem = new ToolbarItem()
            {
                Text  = "Chercher",
                Order = ToolbarItemOrder.Primary,
                Icon  = "search.png"
            };
            searchToolbarItem.Clicked += SearchToolbarItem_Clicked;

            endSearchToolbarItem = new ToolbarItem()
            {
                Text  = "Terminer",
                Order = ToolbarItemOrder.Primary,
                Icon  = "close.png"
            };
            endSearchToolbarItem.Clicked += EndSearchToolbarItem_Clicked;

            sortToolbarItem = new ToolbarItem()
            {
                Text  = "Trier",
                Order = ToolbarItemOrder.Primary,
                Icon  = "sort.png"
            };
            sortToolbarItem.Clicked += SortToolbarItem_Clicked;

            ToolbarItems.Add(searchToolbarItem);
            ToolbarItems.Add(filterToolbarItem);
            ToolbarItems.Add(sortToolbarItem);
            load();
        }