public MaskHandler()
        {
            _shapePicker = new ShapePicker();

            FillModes      = Enum.GetValues(typeof(FillMode)).Cast <FillMode>().ToArray();
            ClipModes      = Enum.GetValues(typeof(ClipMode)).Cast <ClipMode>().ToArray();
            FontAttributes = Enum.GetValues(typeof(FontAttributes)).Cast <FontAttributes>().ToArray();

            EllipseMask = new EllipseMask {
                IsActive = false
            };

            TextMask = new TextMask
            {
                FontSize = 100,
                Text     = "Magic Gradients",
                IsActive = false
            };

            PathMask = new PathMask
            {
                Data     = _shapePicker.GetData("Xamagon"),
                IsActive = false
            };

            Collection = new MaskCollection
            {
                Masks = new GradientElements <GradientMask>
                {
                    EllipseMask, TextMask, PathMask
                }
            };

            ShowPickerCommand = new Command(() => ShowPicker());
        }
Beispiel #2
0
        public LegendItemViewModel Clone()
        {
            LegendItemViewModel newItem = new LegendItemViewModel
            {
                NotifiedGeoFont        = NotifiedGeoFont.Clone(),
                BackgroundMask         = BackgroundMask == null ? null : (AreaStyle)BackgroundMask.CloneDeep(),
                BottomPadding          = BottomPadding,
                Height                 = Height,
                ImageBottomPadding     = ImageBottomPadding,
                ImageHeight            = ImageHeight,
                ImageJustificationMode = ImageJustificationMode,
                ImageLeftPadding       = ImageLeftPadding,
                ImageMask              = ImageMask == null ? null : (AreaStyle)ImageMask.CloneDeep(),
                ImageRightPadding      = ImageRightPadding,
                //ImageStyle = ImageStyle.CloneDeep(),
                ImageTopPadding   = ImageTopPadding,
                ImageWidth        = ImageWidth,
                LeftPadding       = LeftPadding,
                LegendItemType    = LegendItemType,
                TextBottomPadding = TextBottomPadding,
                TextLeftPadding   = TextLeftPadding,
                TextMask          = TextMask == null ? null : (AreaStyle)TextMask.CloneDeep(),
                TextRightPadding  = TextRightPadding,
                TextSolidBrush    = TextSolidBrush,
                TextTopPadding    = TextTopPadding,
                Text       = this.Text,
                TopPadding = TopPadding,
                Width      = Width,
                Parent     = Parent
            };

            if (ImageStyle != null)
            {
                newItem.ImageStyle = ImageStyle.CloneDeep();
            }

            return(newItem);
        }
Beispiel #3
0
        public MaskHandler()
        {
            _shapePicker = new ShapePicker();

            EllipseMask = new EllipseMask {
                IsActive = false
            };

            RectangleMask = new RectangleMask
            {
                IsActive = false,
                Corners  = new Corners(Dimensions.Abs(50, 50))
            };

            TextMask = new TextMask
            {
                FontSize = 100,
                Text     = "Magic Gradients",
                IsActive = false
            };

            PathMask = new PathMask
            {
                Data     = _shapePicker.GetData("Xamagon"),
                IsActive = false
            };

            Collection = new MaskCollection
            {
                Masks = new GradientElements <GradientMask>
                {
                    RectangleMask, EllipseMask, TextMask, PathMask
                }
            };

            ShowPickerCommand = new Command(() => ShowPicker());
        }
 private void OnMaskChanged(TextMask oldMask, TextMask newMask)
 {
     UpdateMaskedText();
 }
 public static TextMask VerticalTextAlignment(this TextMask mask, TextAlignment alignment)
 {
     mask.VerticalTextAlignment = alignment;
     return(mask);
 }
 public static TextMask HorizontalTextAlignment(this TextMask mask, TextAlignment alignment)
 {
     mask.HorizontalTextAlignment = alignment;
     return(mask);
 }
 public static TextMask FontAttributes(this TextMask mask, FontAttributes fontAttributes)
 {
     mask.FontAttributes = fontAttributes;
     return(mask);
 }
 public static TextMask FontSize(this TextMask mask, double fontSize)
 {
     mask.FontSize = fontSize;
     return(mask);
 }
 public static TextMask FontFamily(this TextMask mask, string fontFamily)
 {
     mask.FontFamily = fontFamily;
     return(mask);
 }