これが可能かどうかはわかりませんが、タイトルの質問を説明するコードは次のとおりです。
public class LogicClass : INotifyPropertyChanged
{
private String _myText;
public String MyText
{
get{return _myText;}
set
{
_myText = value;
PropertyChanged(this, new PropertyChangedEventArgs("MyText"));
}
}
...
}
public partial class Window1: Window, INotifyPropertyChanged
{
private LogicClass _logic;
public String LogicText
{
get{return _logic.MyText;}
}
...
}
<ContentControl Name="contentControl1" >
<Binding ElementName="MainWindow" Path="LogicText"/>
</ContentControl>
私のLogicClass
変数を公開し、その実装を利用することなく、これを機能させる方法はありますかINotifyPropertyChanged
. これがバブルアップする可能性があるかどうか、またはUIコードビハインドに冗長性を持たせる必要があること以外のことを知りたいと思いますset
(これが私が今これを行っている方法です)