How to call Invalidate() method inside a Class C#

Keywords: c# .net winforms

Question: 

I have a form and i created a new class for it...but i cant call Invalidate() inside the class

My Code -

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PicsOne.Controls.PicsForm
{

  public partial class PicsForm : Form
  {
      private bool showBorderLine;
      private Color borderLineColor;
      private int borderLineWidth;

    public PicsForm()
    {
        InitializeComponent();

        this.DoubleBuffered = true;
        this.ResizeRedraw = true;
        this.SetStyle(ControlStyles.ResizeRedraw, true);
        this.FormBorderStyle = FormBorderStyle.None;

        borderLineColor = Color.DodgerBlue;
        borderLineWidth = 1;
        showBorderLine = true;
    }

    [Category("Form Editor")]
    public bool ShowBorderLine
    {
        get { return showBorderLine; }
        set
        {
            showBorderLine = value; // Here I can able to call invalidate 
                                    // and it works perfectly
            this.Invalidate(true); 
        }
    }

    [Category("Form Editor")]
    public Color BorderLineColor
    {
        get { return borderLineColor; }
        set
        {
            borderLineColor = value; // Here I can able to call invalidate
                                     // and it works perfectly
            this.Invalidate(true);
        }
    }

    [Category("Form Editor")]
    public int BorderLineWidth
    {
        get { return borderLineWidth; }
        set
        {
            borderLineWidth = value;   // Here I can able to call invalidate  
                                       // and it works perfectly
            this.Invalidate(true);
        }
    }

private ResizeOptions resizeOptions = new ResizeOptions();

    [Category("Form Editor")]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
    public ResizeOptions ResizeOptions
    {
        get { return resizeOptions; }
        set
        {
            resizeOptions = value;
            this.Invalidate(true);
        }
    }
}

[TypeConverter(typeof(ExpandableObjectConverter))]
public class ResizeOptions // Inside this class i cant able to use invalidate method
{
    private bool resizeTop;
    private bool resizeBottom;
    private bool resizeLeft;
    private bool resizeRight;
    private bool resizeTopLeft;
    private bool resizeTopRight;
    private bool resizeBottomLeft;
    private bool resizeBottomRight;
    public ResizeOptions()
    {
        resizeTop = true;
        resizeBottom = true;
        resizeLeft = true;
        resizeRight = true;
        resizeTopRight = true;
        resizeTopLeft = true;
        resizeBottomLeft = true;
        resizeBottomRight = true;
        resizeTopRight = true;
    }

    [Category("Form Editor")]
    public bool ResizeTop
    {
        get { return resizeTop; }
        set { resizeTop = value; } // I want to call invalidate method here
    }

    [Category("Form Editor")]
    public bool ResizeBottom
    {
        get { return resizeBottom; } // I want to call invalidate method here
        set { resizeBottom = value; }
    }

    [Category("Form Editor")]
    public bool ResizeLeft
    {
        get { return resizeLeft; } // I want to call invalidate method here
        set { resizeLeft = value; }
    }

    [Category("Form Editor")]
    public bool ResizeRight
    {
        get { return resizeRight; } // I want to call invalidate method here
        set { resizeRight = value; }
    }

    [Category("Form Editor")]
    public bool ResizeTopLeft
    {
        get { return resizeTopLeft; } // I want to call invalidate method here
        set { resizeTopLeft = value; }
    }

    [Category("Form Editor")]
    public bool ResizeTopRight
    {
        get { return resizeTopRight; } // I want to call invalidate method here
        set { resizeTopRight = value; }
    }

    [Category("Form Editor")]
    public bool ResizeBottomLeft
    {
        get { return resizeBottomLeft; } // I want to call invalidate method here
        set { resizeBottomLeft = value; }
    }

    [Category("Form Editor")]
    public bool ResizeBottomRight
    {
        get { return resizeBottomRight; } // I want to call invalidate method here
        set { resizeBottomRight = value; }
    }
}

You can see the invalidate method is possible inside the Form Class but i cant able to use it in ResizeOptions Class

i call invalidate method for get design time support for properties...

if you want i can provide the full code

please help me..

Answers: