How to refresh the data accessed a page in my application, using MVVM
Light Windows Phone 7?
I have several pages of an application on Windows Phone 7 using MVVM
Light, when I log in the application command to call the necessary
services and return me to the login page, right there by the data
(username and password) to initiate session, and when I come in, in the
pages following the data previously bonded user, and do not update the new
data, I have the binding properties and raisePropertyChanged. How do I
initialize the data again and filled again.
Thank you.
This is a example of my code in ViewModel:
public class LoginViewModel:ViewModelBase
{
ILoginService _loginService;
INavigationService _navigationService;
private string _usuario;
public string Usuario
{
get { return _usuario; }
set { if (_usuario != value) { _usuario = value;
RaisePropertyChanged("Usuario"); } }
}
private string _contraseña;
public string Contraseña
{
get { return _contraseña; }
set { if (_contraseña != value) { _contraseña = value;
RaisePropertyChanged("Contraseña"); } }
}
public LoginViewModel(ILoginService loginService, INavigationService
navigationService)
{
//my code....
}
}
and the code XAML in my View:
<TextBlock Grid.Row="1" Text="Usuario" Style="{StaticResource
TextosEtiquetasLogin}"/>
<TextBox Grid.Row="2" Text="{Binding Usuario, Mode=TwoWay}"
Style="{StaticResource CuadrosTexto}" />
<TextBlock Grid.Row="3" Text="Contraseña" Style="{StaticResource
TextosEtiquetasLogin}"/>
<PasswordBox x:Name="txtPass" Grid.Row="4" Password="{Binding Contraseña,
Mode=TwoWay}" Style="{StaticResource CuadrosTextoPass}">
Thanks, I hope you can help me...
No comments:
Post a Comment