Esempio n. 1
0
 private void OnInit(object sender, EventArgs e)
 {
     myShirt = new Shirt();
     PopulateListbox(ShirtChoice, Enum.GetValues(typeof(ShirtTypes)));
     PopulateListbox(ShirtColorChoice, Enum.GetValues(typeof(ShirtColors)));
     PopulateListbox(ButtonChoice, Enum.GetValues(typeof(ButtonColors)));
     myShirt.ButtonColorChanged += new RoutedEventHandler(UIButtonColorChanged);
 }
Esempio n. 2
0
        private void UIButtonColorChanged(object sender, RoutedEventArgs e)
        {
            Shirt        s = (Shirt)e.Source;
            ButtonColors b = s.ButtonColor;

            if (b == ButtonColors.None)
            {
                ButtonChoice.Visibility      = Visibility.Hidden;
                ButtonChoiceLabel.Visibility = Visibility.Hidden;
            }
            else
            {
                ButtonChoice.Visibility      = Visibility.Visible;
                ButtonChoiceLabel.Visibility = Visibility.Visible;
            }
        }