簡単な作業のようです。MVVMビューからパブリックプロパティ値を渡したいのですが、タイプのプロパティに「バインディング」を設定できません。「バインディング」はにのみ設定できます。依存関係オブジェクトの依存関係プロパティ」エラー。
監視可能なコレクションとアイテムのレンダリングを繰り返しており、テンプレートコードをユーザーコントロールに移動したいと思います。一体どうやってこれを解決できますか????
<local:xIPAddressControl UserControlIPAddressText="{Binding Path=IPAddress, RelativeSource={RelativeSource Mode=Self}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
UserControl
public partial class xIPAddressControl : UserControl
{
public xIPAddressControl()
{
this.InitializeComponent();
}
public string UserControlIPAddressText
{
get { return this.xIPAddressTextBlock.Text; }
set { this.xIPAddressTextBlock.Text = value; }
}
}