Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在运行时更改WPF源_Wpf_Lync - Fatal编程技术网

在运行时更改WPF源

在运行时更改WPF源,wpf,lync,Wpf,Lync,我想在运行时从MainWindow.xaml.cs文件更改source属性。我的当前代码显示在此处下方 <controls:StartVideoCallButton Name="accountString" Source="sip:stj@starck.onmicrosoft.com" Height="75" Width="314" Background="#FFC7C7C7"></controls:StartVideoCallButton>

我想在运行时从MainWindow.xaml.cs文件更改source属性。我的当前代码显示在此处下方

                <controls:StartVideoCallButton Name="accountString" Source="sip:stj@starck.onmicrosoft.com" Height="75" Width="314" Background="#FFC7C7C7"></controls:StartVideoCallButton>

这对我很有用:

accountString.Source = "sip:new.sip@company.com";

或者,您可以使用该模式绑定source属性以将UI与业务逻辑分离-这是WPF应用程序的首选方法

accountString.source=?