This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#time | |
open System.IO | |
open System.Globalization | |
let EnumerateDirectories path = | |
Directory.EnumerateDirectories(path) |> Seq.toList | |
let isObjOrBinFolder (folderName:string) = | |
folderName.EndsWith("obj", true, CultureInfo.InvariantCulture) || folderName.EndsWith("bin", true, CultureInfo.InvariantCulture) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public LoginPage () | |
{ | |
InitializeComponent (); | |
BindingContext = ViewModel; | |
UsernameEntry.Completed += (sender, args) => { PasswordEntry.Focus(); }; | |
PasswordEntry.Completed += (sender, args) => { ViewModel.AuthenticateCommand.Execute(null); }; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void OnAppearing() | |
{ | |
if (!App.IsUserLoggedIn) | |
{ | |
App.NavigationService.NavigateModalAsync(PageNames.LoginPage, false); | |
} | |
base.OnAppearing(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Logout() | |
{ | |
_navigationService.NavigateModalAsync(PageNames.LoginPage); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using System.Windows.Input; | |
using LoginViewSample.Core.Services; | |
using Xamarin.Forms; | |
namespace LoginViewSample.Core.ViewModels | |
{ | |
public class LoginViewModel : INotifyPropertyChanged | |
{ | |
private string _username; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="LoginViewSample.Core.Views.LoginPage"> | |
<ContentPage.Content> | |
<Grid Margin="16"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto"/> | |
<RowDefinition Height="*"/> | |
<RowDefinition Height="Auto"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class App : Application | |
{ | |
public App() | |
{ | |
InitializeComponent(); | |
NavigationService.Configure("MainPage", typeof(Views.MainPage)); | |
NavigationService.Configure("ModalNavigationPage", typeof(Views.ModalNavigationPage)); | |
NavigationService.Configure("PushNavigationPage", typeof(Views.PushNavigationPage)); | |
var mainPage = ((ViewNavigationService) NavigationService).SetRootPage("MainPage"); |
NewerOlder