Winform与WPF异步修改控件属性

Winform方式:
    if (this.InvokeRequired)
            {
                this.Invoke(
                    new Action (
                        delegate(Form form1)
                        {
                            lblTip.Content = msg;
                        })
                    , this
                );
            }
WPF方式:
            this.Dispatcher.BeginInvoke((Action)delegate()
            {
                lblTip.Content = msg;
            });
posted @ 2017-03-13 18:05  Yanina2011  阅读(408)  评论(0编辑  收藏  举报