private Visibility _loginFieldsVisibility = Visibility.Visible;
private DelegateCommand _showPasswordCommand;
- private DelegateCommand _savePasswordCommand;
private DelegateCommand _loginCommand;
public string ip
public string password
{
get { return _password; }
- set { SetProperty(ref _password, value); }
+ set {
+ // TODO: find a better way
+ if (value.IsNullOrEmpty().Equals(true))
+ {
+ if (SavePassword.Equals(true))
+ return;
+
+ }
+ SetProperty(ref _password, value);
+ }
}
public string LoginButtonText
set { SetProperty(ref _showPasswordCommand, value); }
}
- public DelegateCommand SavePasswordCommand
- {
- get { return _savePasswordCommand; }
- set { SetProperty(ref _savePasswordCommand, value); }
- }
-
public DelegateCommand LoginCommand
{
get { return _loginCommand; }
}
}
- private void OnSavePasswordCommandExecute()
- {
- Console.WriteLine(SavePassword);
- }
-
private void OnLoginCommandExecute()
{
MainWindowModel mwm = Application.Current.FindResource("MainWindowModel") as MainWindowModel;
Settings.save(SettingsModel);
}
+
LoginFieldsVisibility = Visibility.Hidden;
mwm.ButtonOverviewPageIsActive = true;
mwm.ButtonDSLPageIsActive = true;
else {
if (SpeedportHybridAPI.getInstance().logout().Equals(true))
{
- // TODO: util.logout();
LogoutAction();
}
}
public void LogoutAction()
{
+ LteInfoModel lim = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
+ lim.ClosePopup();
+ lim.StopTimer();
+
+ DslPageModel dpm = Application.Current.FindResource("DslPageModel") as DslPageModel;
+ dpm.StopTimer();
+
MainWindowModel mwm = Application.Current.FindResource("MainWindowModel") as MainWindowModel;
LoginFieldsVisibility = Visibility.Visible;
mwm.ButtonOverviewPageIsActive = false;
}
ShowPasswordCommand = new DelegateCommand(new Action(OnShowPasswordCommandExecute));
- SavePasswordCommand = new DelegateCommand(new Action(OnSavePasswordCommandExecute));
LoginCommand = new DelegateCommand(new Action(OnLoginCommandExecute));
}
}
<TextBlock Text="Passwort:" HorizontalAlignment="Left" Margin="55,49,0,0" VerticalAlignment="Top" />
<PasswordBox Implementations:PasswordHelper.BindPassword="true" Implementations:PasswordHelper.BoundPassword="{Binding Path=password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding Path=PasswordBoxVisibility}" x:Name="passwordBox" HorizontalAlignment="Left" Height="23" Margin="115,42,0,0" VerticalAlignment="Top" Width="120" ForceCursor="True" />
- <TextBox Text="{Binding Path=password, Mode=TwoWay}" HorizontalAlignment="Left" Height="23" Margin="115,42,0,0" VerticalAlignment="Top" Width="120" Visibility="{Binding Path=PasswordTextBoxVisibility}"/>
+ <TextBox Text="{Binding Path=password}" HorizontalAlignment="Left" Height="23" Margin="115,42,0,0" VerticalAlignment="Top" Width="120" Visibility="{Binding Path=PasswordTextBoxVisibility}"/>
<CheckBox Command="{Binding Path=ShowPasswordCommand}" IsChecked="{Binding Path=ShowPassword, Mode=TwoWay}" Content="Passwort anzeigen" Margin="240,50,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
- <CheckBox Command="{Binding Path=SavePasswordCommand}" IsChecked="{Binding Path=SavePassword, Mode=TwoWay}" Content="Passwort speichern" Margin="240,65,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
+ <CheckBox IsChecked="{Binding Path=SavePassword, Mode=TwoWay}" Content="Passwort speichern" Margin="240,65,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
</Grid>
<Button Command="{Binding Path=LoginCommand}" Content="{Binding Path=LoginButtonText}" HorizontalAlignment="Left" Margin="115,70,0,0" VerticalAlignment="Top" Width="75" IsDefault="True"/>
</Grid>