Ejemplo n.º 1
0
        private void SetStarStyle(int starIndex, StarStyleEnum style)
        {
            RegularPolygon star            = (RegularPolygon)this.FindName("Star" + starIndex.ToString());
            Color          fillColor       = ColorProvider.CustomBlack();
            Color          strokeColor     = ColorProvider.StrokeActive();
            double         strokeThickness = 1.5;

            switch (style)
            {
            case StarStyleEnum.Active:
                fillColor   = ColorProvider.CustomBlack();;
                strokeColor = ColorProvider.StrokeActive();
                break;

            case StarStyleEnum.Solved:
                fillColor   = ColorProvider.CustomGreen();
                strokeColor = ColorProvider.StrokeActive();
                break;

            case StarStyleEnum.Inactive:
                fillColor       = ColorProvider.CustomBlack();;
                strokeColor     = ColorProvider.StrokeInactive();
                strokeThickness = 2;
                break;
            }
            star.Fill            = new SolidColorBrush(fillColor);
            star.Stroke          = new SolidColorBrush(strokeColor);
            star.StrokeThickness = strokeThickness;
        }
Ejemplo n.º 2
0
 public MainPage()
 {
     InitializeComponent();
     _timeColors         = new Color[] { ColorProvider.CustomRed(), Colors.Yellow, ColorProvider.CustomGreen() };
     _colorChangeValue   = (int)Math.Floor(AppContext.LEVELTIME / 3);
     textCurrentSum.Text = AppResources.SumText + " 0";
     //TODO ovo treba otkačiti pri deaktivaciji aplikacije
     this.LeftTextBlock.MouseLeftButtonDown   += new MouseButtonEventHandler(OnNumberSelected);
     this.LeftShape.MouseLeftButtonDown       += new MouseButtonEventHandler(OnNumberSelected);
     this.RightTextBlock.MouseLeftButtonDown  += new MouseButtonEventHandler(OnNumberSelected);
     this.RightShape.MouseLeftButtonDown      += new MouseButtonEventHandler(OnNumberSelected);
     this.TopTextBlock.MouseLeftButtonDown    += new MouseButtonEventHandler(OnNumberSelected);
     this.TopShape.MouseLeftButtonDown        += new MouseButtonEventHandler(OnNumberSelected);
     this.BottomTextBlock.MouseLeftButtonDown += new MouseButtonEventHandler(OnNumberSelected);
     this.BottomShape.MouseLeftButtonDown     += new MouseButtonEventHandler(OnNumberSelected);
     _validNumbers = new List <int>();
     InitAppContext();
     InitTimer();
     _levels = LevelManager.GetLevels();
     SetupLevel();
 }
Ejemplo n.º 3
0
        private void SetItemStyle(TextBlock textBlock, bool selected)
        {
            Ellipse shape = null;

            switch (textBlock.Name)
            {
            case "LeftTextBlock":
                shape = this.LeftShape;
                break;

            case "RightTextBlock":
                shape = this.RightShape;
                break;

            case "TopTextBlock":
                shape = this.TopShape;
                break;

            case "BottomTextBlock":
                shape = this.BottomShape;
                break;
            }

            SolidColorBrush mySolidColorBrush = new SolidColorBrush();
            int             strokeThickness   = 5;

            if (selected)
            {
                mySolidColorBrush.Color = ColorProvider.CustomGreen();
                strokeThickness         = 5;
            }
            else
            {
                mySolidColorBrush.Color = Color.FromArgb(255, 82, 152, 183);
                strokeThickness         = 3;
            }
            shape.Fill            = mySolidColorBrush;
            shape.StrokeThickness = strokeThickness;
        }