在运行时更改WPF源
我想在运行时从MainWindow.xaml.cs文件更改source属性。我的当前代码显示在此处下方在运行时更改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>
<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=?