Exemplo n.º 1
0
        private void navBar_uruntanim_Click(object sender, EventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                RibbonPageGroup_Home.IsEnabled = true;
                ProUC = new ProductUserControl();

                DXTabItem tabItem = new DXTabItem()
                {
                    Header     = navBar_uruntanim.Content,
                    Content    = ProUC,
                    AllowHide  = DevExpress.Utils.DefaultBoolean.True,
                    IsSelected = true
                };

                foreach (DXTabItem item in TabControlMain.Items)
                {
                    if (item.Header == navBar_uruntanim.Content)
                    {
                        TabControlMain.RemoveTabItem(item);
                        break;
                    }
                }

                TabControlMain.Items.Add(tabItem);
            });
        }
        /// <summary>
        /// Searches using the given search terms and outputs to the page all the results that match that criteria.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void FindButtonClick(object sender, RoutedEventArgs e)
        {
            StaticData.masterPage.ShowProgressRing();
            string searchTerms = SearchTermsTextBox.Text;

            if (searchTerms == searchTermsCache)
            {
                return;
            }
            if (string.IsNullOrEmpty(searchTerms))
            {
                // Clear the results
                this.PageContentStackPanel.Children.Clear();
            }
            else
            {
                this.PageContentStackPanel.Children.Clear();
                // Perform a search
                foreach (var product in await Middleware.MiddlewareConnections.SearchForProduct(searchTerms))
                {
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        var visualProduct = new ProductUserControl();
                        visualProduct.SetData(product);
                        visualProduct.Tapped += VisualProductOnTapped;
                        visualProduct.Margin  = new Thickness(10, 10, 10, 50);
                        PageContentStackPanel.Children.Add(visualProduct);
                    });
                }
            }
            searchTermsCache = searchTerms;
            StaticData.masterPage.HideProgressRing();
        }
Exemplo n.º 3
0
        private void productButton_Click(object sender, EventArgs e)
        {
            sideBarPanel.Height = productButton.Height;
            sideBarPanel.Top    = productButton.Top;

            ProductUserControl productUserControl = new ProductUserControl();

            ShowControl(productUserControl);
        }
        /// <summary>
        /// Externally load a product into this page and display on the screen
        /// </summary>
        /// <param name="product"></param>
        public void SetData(Product product)
        {
            this.product = product;
            var userControl = new ProductUserControl();

            userControl.SetData(product);
            ProductGrid.Children.Add(userControl);
            NewQuantityTextBox.Text = product.stockCount.ToString();
        }