Hi!
I want to do the following:
I have a class like this (just an example):
public class UserItem : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
var handler = PropertyChanged;
if (handler != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
private string _UserName;
private string _ComputerName;
private string _eMailAddress;
private DocumentAdv _Doc;
public string UserName
{
get { return _UserName; }
set
{
_UserName = value;
OnPropertyChanged("UserName");
}
}
public string ComputerName
{
get { return _ComputerName; }
set
{
_ComputerName = value;
OnPropertyChanged("ComputerName");
}
}
public string eMailAddress
{
get { return _eMailAddress; }
set
{
_eMailAddress = value;
OnPropertyChanged("eMailAddress");
}
}
public DocumentAdv Doc
{
get { return _Doc; }
set
{
_Doc= value;
OnPropertyChanged("Doc");
}
}
}
This I'd like to bind in a ViewModel to the SfRichTextBoxAdv.
Something like:
<ComboBox ItemSource={Binding AllUsers}>
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBox Text={Binding UserName} />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<syncfusion:SfRichTextBoxAdv x:Name="rtbComments"
Height="300"
LayoutType="Continuous"
EnableMiniToolBar="False"
Document="{Binding SelectedUser.Doc}"/>
Now without using CodeBehind I'd like to change the Document if I select a different User.
I hope you now get what I'd like to accieve :-)
Thank you very much!
Victor