void IncarcaAnimale() { lupa.Visibility = Visibility.Collapsed; CRCuvant.Ascunde(); CRRegiune.Ascunde(); CRQA.Ascunde(); search.Ascunde(); lol.Ascunde(); canvas2.Children.Remove(sv); #region ButoanDesSusNormal CBuy.Children.Clear(); CBuy.AddTextBlock(new TextBlock(), "Buy", 23, 20, 10, "#FF959906"); CBuy.Border(new CornerRadius(0, 0, 0, 0), "#00000000", new Thickness(1), 80, 60); Buy.Height = 59; CSell.Children.Clear(); CSell.AddTextBlock(new TextBlock(), "Sell", 23, 20, 10, "#FF959906"); CSell.Border(new CornerRadius(0, 0, 0, 0), "#00000000", new Thickness(1), 80, 60); Sell.Height = 59; #endregion mousepresstrades = true; mousepressbuy = mousepresssell = false; try { if (adauga == true) { #region Canvasu din Stanga CreateOffer.Background = new SolidColorBrush(Colors.Transparent); CreateOffer.Width = 200; CreateOffer.Height = 400; canvas2.Children.Add(CreateOffer); Canvas.SetLeft(CreateOffer, 15); Canvas.SetTop(CreateOffer, 100); TextBlock t = new TextBlock() { Text = "Create an offer", FontSize = 17, FontFamily = new FontFamily("Tahoma"), Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x7d, 0x91, 0x96)) }; CreateOffer.Children.Add(t); Canvas.SetLeft(t, 5); Canvas.SetTop(t, 0); #endregion Canvasu din stanga #region SellBuy ControlCuColturiRotunde CRBuySell = new ControlCuColturiRotunde(CreateOffer, 206, 39, 0, 40, false, 1); CRBuySell.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRBuySell.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40); CRBuySell.Colturi(10, 10, new Rect(0, 0, 206, 38)); CRBuySell.AddTextBlock(new TextBlock(), "I want to:", 15, 5, 10, null); ComboBoxItem cbiBuySell = new ComboBoxItem(); cbiBuySell.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiBuySell.Content = "Buy"; cbiBuySell.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)); cbBuySell.Width = 120; cbBuySell.Items.Add(cbiBuySell); cbiBuySell = new ComboBoxItem(); cbiBuySell.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiBuySell.Content = "Sell"; cbBuySell.Items.Add(cbiBuySell); cbBuySell.SelectedIndex = 0; cbBuySell.Style = (Style)Application.Current.Resources["ComboBoxStyle1"]; CRBuySell.AddDropDown(cbBuySell, "#FF000000", "#00000000", 15, 85, 7); cbBuySell.MouseEnter += new MouseEventHandler(cb_MouseEnter); cbBuySell.MouseLeave += new MouseEventHandler(cb_MouseLeave); #endregion BuySell #region Type ControlCuColturiRotunde CRType = new ControlCuColturiRotunde(CreateOffer, 206, 39, 0, 90, false, 1); CRType.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRType.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40); CRType.Colturi(10, 10, new Rect(0, 0, 206, 38)); CRType.AddTextBlock(new TextBlock(), "Type:", 15, 5, 10, null); ComboBoxItem cbiType = new ComboBoxItem(); cbiType.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiType.Content = "Fauna"; cbiType.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)); cbType.Items.Add(cbiType); cbiType = new ComboBoxItem(); cbiType.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiType.Content = "Vegetation"; cbType.Items.Add(cbiType); CRType.AddDropDown(cbType, "#FF000000", "#00000000", 15, 55, 7); cbType.Width = 150; cbType.SelectedIndex = 0; cbType.Style = (Style)Application.Current.Resources["ComboBoxStyle1"]; cbType.MouseEnter += new MouseEventHandler(cbType_MouseEnter); cbType.MouseLeave += new MouseEventHandler(cbType_MouseLeave); #endregion Type #region Species ControlCuColturiRotunde CRSpecies = new ControlCuColturiRotunde(CreateOffer, 206, 39, 0, 140, false, 1); CRSpecies.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRSpecies.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40); CRSpecies.Colturi(10, 10, new Rect(0, 0, 206, 38)); CRSpecies.AddTextBlock(new TextBlock(), "Species:", 15, 5, 10, null); //string[] ss = new string[] {"sorici","ursulet","cocolino","petrescu","kek","donici","motorga","guster","petarde","ursulet 2","jjj","rexona","for men" }; ComboBoxItem cbiSpecies; for (int i = 0; i < Toateanimalele.Count; i++) { cbiSpecies = new ComboBoxItem(); cbiSpecies.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiSpecies.Content = Toateanimalele[i]; cbiSpecies.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)); cbSpecies.Items.Add(cbiSpecies); } CRSpecies.AddDropDown(cbSpecies, "#FF000000", "#00000000", 15, 75, 7); cbSpecies.Width = 130; // cbSpecies.SelectedIndex = 0; cbSpecies.Style = (Style)Application.Current.Resources["ComboBoxStyle1"]; cbSpecies.MouseEnter += new MouseEventHandler(cbSpecies_MouseEnter); cbSpecies.MouseLeave += new MouseEventHandler(cbSpecies_MouseLeave); #endregion Species #region Quantity ControlCuColturiRotunde CRQuantity = new ControlCuColturiRotunde(CreateOffer, 206, 39, 0, 190, false, 1); CRQuantity.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRQuantity.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40); CRQuantity.Colturi(10, 10, new Rect(0, 0, 206, 38)); CRQuantity.AddTextBlock(new TextBlock(), "Quantity:", 15, 5, 10, null); CRQuantity.AddTextBox(numar, "", 100, 30, 0, 15, "#FF000000", "#FF000000", "#FF581818", "#FFBE4141", null, true, 90, 5); #endregion Quantity #region Price ControlCuColturiRotunde CRPrice = new ControlCuColturiRotunde(CreateOffer, 206, 39, 0, 240, false, 1); CRPrice.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRPrice.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40); CRPrice.Colturi(10, 10, new Rect(0, 0, 206, 38)); CRPrice.AddTextBlock(new TextBlock(), "Price:", 15, 5, 10, null); CRPrice.AddTextBox(pret, "", 110, 30, 0, 15, "#FF000000", "#FF000000", "#FF581818", "#FFBE4141", null, true, 50, 5); #endregion Price #region Shipping ControlCuColturiRotunde CRShipping = new ControlCuColturiRotunde(CreateOffer, 206, 39, 0, 290, false, 1); CRShipping.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRShipping.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40); CRShipping.Colturi(10, 10, new Rect(0, 0, 206, 38)); CRShipping.AddTextBlock(new TextBlock(), "Shipping", 15, 5, 10, null); cbShipping.Width = 120; for (int i = 0; i < ListaFrime.Count; i++) { ComboBoxItem cbiShipping = new ComboBoxItem(); cbiShipping.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiShipping.Content = ListaFrime[i]; cbiShipping.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)); cbShipping.Items.Add(cbiShipping); } cbShipping.SelectedIndex = 0; cbShipping.Style = (Style)Application.Current.Resources["ComboBoxStyle1"]; CRShipping.AddDropDown(cbShipping, "#FF000000", "#00000000", 15, 85, 7); cbShipping.MouseEnter += new MouseEventHandler(cbShipping_MouseEnter); cbShipping.MouseLeave += new MouseEventHandler(cbShipping_MouseLeave); #endregion Shipping #region Buton ControlCuColturiRotunde ccr = new ControlCuColturiRotunde(CreateOffer, 206, 39, 0, 340, false, 1); ccr.Colors("#FF969a07", "#FF7a7d04", new Point(0.5, 1), new Point(0.5, 0), null); ccr.Border(new CornerRadius(10, 10, 10, 10), "#FF9fa13a", new Thickness(1), 208, 40); ccr.Colturi(10, 10, new Rect(0, 0, 206, 38)); ccr.AddTextBlock(new TextBlock(), "Post offer", 17, 70, 5, "#ffe0e1c0"); ccr.Cursor = Cursors.Hand; adaugaoferta = ccr.intoarce(); adaugaoferta.MouseLeftButtonDown += new MouseButtonEventHandler(adaugaoferta_MouseLeftButtonDown); #endregion adauga = false; } else { canvas2.Children.Add(CreateOffer); } } catch (Exception ex) { MessageBox.Show(ex.Message); } b.IsBusy = false; }
void adaugaSearch() { #region Keywords KeyWords = new TextBox(); CRCuvant = new ControlCuColturiRotunde(canvas2, 286, 39, 50, 73, false, 1); CRCuvant.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRCuvant.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 288, 40); CRCuvant.Colturi(10, 10, new Rect(0, 0, 286, 38)); CRCuvant.AddTextBlock(new TextBlock(), "Keywords:", 15, 5, 10, null); CRCuvant.AddTextBox(KeyWords, "", 170, 30, 0, 15, "#FF000000", "#FF000000", "#FF581818", "#FFBE4141", null, true, 90, 5); #endregion Keywords #region Regiune try { CRRegiune = new ControlCuColturiRotunde(canvas2, 206, 39, 355, 73, false, 1); CRRegiune.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRRegiune.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40); CRRegiune.Colturi(10, 10, new Rect(0, 0, 206, 38)); CRRegiune.AddTextBlock(new TextBlock(), "Region :", 14, 5, 10, "#FF000000"); string[] regiuni = new string[] { "Moldova", "Transilvania", "Dobrogea", "Oltenia", "Banat" }; for (int i = 0; i < regiuni.Length; i++) { ComboBoxItem cbiBuySell = new ComboBoxItem(); cbiBuySell.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiBuySell.Content = regiuni[i]; cbiBuySell.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)); cbRegiune.Items.Add(cbiBuySell); } cbRegiune.Width = 120; cbRegiune.SelectedIndex = 0; cbRegiune.Style = (Style)Application.Current.Resources["ComboBoxStyle1"]; CRRegiune.AddDropDown(cbRegiune, "#FF000000", "#00000000", 15, 85, 7); } catch (Exception ex) { MessageBox.Show(ex.Message); } #endregion Regiune #region Buton Search search = new ControlCuColturiRotunde(canvas2, 126, 39, 580, 73, false, 1); search.Colors("#FF969a07", "#FF7a7d04", new Point(0.5, 1), new Point(0.5, 0), null); search.Border(new CornerRadius(10, 10, 10, 10), "#FF9fa13a", new Thickness(1), 128, 40); search.Colturi(10, 10, new Rect(0, 0, 126, 38)); search.AddTextBlock(new TextBlock(), "Search", 17, 40, 5, "#ffe0e1c0"); search.Cursor = Cursors.Hand; Search = search.intoarce(); Search.MouseLeftButtonDown += new MouseButtonEventHandler(Search_MouseLeftButtonDown); #endregion Buton Search #region SearchDAQA lol = new ControlCuColturiRotunde(canvas2, 26, 29, 10, 130, false, 1); lol.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); lol.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 28, 30); lol.Colturi(10, 10, new Rect(0, 0, 26, 28)); chceck = lol.intoarce(); chceck.MouseLeftButtonDown += new MouseButtonEventHandler(chceck_MouseLeftButtonDown); CRQA = new ControlCuColturiRotunde(canvas2, 326, 39, 50, 123, false, 1); CRQA.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null); CRQA.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 328, 40); CRQA.Colturi(10, 10, new Rect(0, 0, 326, 38)); CRQA.AddTextBlock(new TextBlock(), "Order by :", 14, 5, 10, "#FF000000"); string[] alege = new string[] { "Price", "Quantity" }; for (int i = 0; i < alege.Length; i++) { ComboBoxItem cbiBuySell = new ComboBoxItem(); cbiBuySell.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiBuySell.Content = alege[i]; cbiBuySell.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)); cbSortPQ.Items.Add(cbiBuySell); } cbSortPQ.Width = 100; cbSortPQ.SelectedIndex = 0; cbSortPQ.Style = (Style)Application.Current.Resources["ComboBoxStyle1"]; CRQA.AddDropDown(cbSortPQ, "#FF000000", "#00000000", 15, 85, 7); string[] alege2 = new string[] { "Descending", "Ascending" }; for (int i = 0; i < alege.Length; i++) { ComboBoxItem cbiBuySell = new ComboBoxItem(); cbiBuySell.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x95, 0x99, 0x06)); cbiBuySell.Content = alege2[i]; cbiBuySell.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)); cbSortAD.Items.Add(cbiBuySell); } cbSortAD.Width = 120; cbSortAD.SelectedIndex = 0; cbSortAD.Style = (Style)Application.Current.Resources["ComboBoxStyle1"]; CRQA.AddDropDown(cbSortAD, "#FF000000", "#00000000", 15, 175, 7); #endregion }