开发者

How to use margin as property of WPF usercontrol?

How to use margin as property of WPF usercontrol?

    public Double pCusSPAge
    {
        get
        {
            return btnCusSPAge.Margin.Left;
        }
        set
        {
            btnCusSPAge.Margin = new Thickness(value);
            if (PropertyChanged 开发者_如何学Python!= null)
                PropertyChanged(this, new PropertyChangedEventArgs("pCusSPAge"));
        }
    }


UserControl have a Margin Property and you use it like this...

to set it:

        Thickness newMargin = new Thickness(1, 1, 1, 1); //just an example
        UserControl.Margin = newMargin;

to get it:

        Thickness newMargin = new Thickness(); 
        newMargin = UserControl.Margin;

Is that what you wanted to know?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜