Here my xaml file :
<TextBox Height="30" Width="100" Text="{Binding Path=txtName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="346,239,346,150"/>
<Button Name="Submit" Height="30" Width="100" Content="Submit Me" Command="{Binding submit}" CommandParameter="{Binding Text, ElementName=fName}" Margin="346,185,346,204"/>
<TextBox Height="30" Width="100" Text="{Binding Path=copyName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="346,135,346,254" />
This is my ViewModel.cs
public event PropertyChangedEventHandler PropertyChanged;
private string _txtName;
public string txtName
{
get { return _txtName; }
set {
_txtName = value;
OnPropertyChanged("txtName");
}
}
private int _copyName;
public int copyName
{
get { return _copyName; }
set { _copyName = value;
OnPropertyChanged("copyName");
}
}
0 Answer(s)