Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented back button in the login view #26

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public CrmLoginViewModel(IPortableNavigationService navigationService)
this.navigationService = navigationService;

LoginCommand = new RelayCommand(LoginCommand_Executed, () => !string.IsNullOrWhiteSpace(Login) && !string.IsNullOrEmpty(Password));
BackCommand = new RelayCommand(BackCommand_Executed);
}

public string Login
Expand All @@ -40,6 +41,8 @@ public string Password
}

public ICommand LoginCommand { get; set; }
public ICommand BackCommand { get; set; }

public CrmPluginViewModel SourcePlugin { private get; set; }

private void LoginCommand_Executed()
Expand All @@ -48,5 +51,10 @@ private void LoginCommand_Executed()

navigationService.NavigateTo(Location.Main);
}

private void BackCommand_Executed()
{
navigationService.NavigateTo(Location.Main);
}
}
}
3 changes: 3 additions & 0 deletions Source/TimesheetParser/View/CrmLoginPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<ColumnDefinition Width="200"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<WrapPanel Grid.Column="0" Grid.Row="0">
<Button Style="{StaticResource LowButtonStyle}" Command="{Binding BackCommand}">Back</Button>
</WrapPanel>
<StackPanel Grid.Column="1" Grid.Row="1" Orientation="Vertical">
<TextBlock>Login:</TextBlock>
<TextBox Text="{Binding Login, UpdateSourceTrigger=PropertyChanged}" />
Expand Down