Ejemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tempTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 2:
                this.locationTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.descriptionTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 4:
                this.Clothes = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.clothesPrevBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 6:
                this.OuterBlock = ((HowWear.ViewModel.ClothesTextBlock)(target));
                return;

            case 7:
                this.TopBlock1 = ((HowWear.ViewModel.ClothesTextBlock)(target));
                return;

            case 8:
                this.TopBlock2 = ((HowWear.ViewModel.ClothesTextBlock)(target));
                return;

            case 9:
                this.BottomBlock = ((HowWear.ViewModel.ClothesTextBlock)(target));
                return;

            case 10:
                this.clothesNextBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 11:
                this.RandomBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 12:
                this.SettingBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 13:
                this.subGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 14:
                this.prevBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 15:
                this.nextBtn = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 2
0
        private static void OnNameCol(DependencyObject source, DependencyPropertyChangedEventArgs e)
        {
            ClothesTextBlock block = source as ClothesTextBlock;
            SolidColorBrush  col   = null;

            if (block.ClothesName != null)
            {
                string color = (block.ClothesName as string).Split(' ')[0];

                if (color.Equals("beige"))
                {
                    col = Brushes.Beige;
                }
                else if (color.Equals("brown"))
                {
                    col = Brushes.Brown;
                }
                else if (color.Equals("yellow"))
                {
                    col = Brushes.Yellow;
                }
                else if (color.Equals("khaki"))
                {
                    col = Brushes.Khaki;
                }
                else if (color.Equals("navy"))
                {
                    col = Brushes.Navy;
                }
                else if (color.Equals("white"))
                {
                    col = Brushes.White;
                }
                else if (color.Equals("gray"))
                {
                    col = Brushes.DarkGray;
                }
                else if (color.Equals("black"))
                {
                    col = Brushes.Black;
                }
                else if (color.Equals("red"))
                {
                    col = Brushes.Red;
                }
                else if (color.Equals("orange"))
                {
                    col = Brushes.Orange;
                }
                else if (color.Equals("green"))
                {
                    col = Brushes.Green;
                }
                else if (color.Equals("aqua"))
                {
                    col = Brushes.Aquamarine;
                }
                else if (color.Equals("skyblue"))
                {
                    col = Brushes.SkyBlue;
                }
                else if (color.Equals("blue"))
                {
                    col = Brushes.Blue;
                }
                else if (color.Equals("purple"))
                {
                    col = Brushes.Purple;
                }
                else if (color.Equals("pink"))
                {
                    col = Brushes.LightPink;
                }
                else if (color.Equals("light_blue"))
                {
                    col = Brushes.LightBlue;
                }
                else if (color.Equals("deep_blue"))
                {
                    col = Brushes.DarkBlue;
                }
            }
            if (col != null)
            {
                block.Foreground = col;
            }
        }