diff --git a/BookAStar/BookAStar/Pages/DocSigning.xaml.cs b/BookAStar/BookAStar/Pages/DocSigning.xaml.cs new file mode 100644 index 00000000..b284eee6 --- /dev/null +++ b/BookAStar/BookAStar/Pages/DocSigning.xaml.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; + +namespace BookAStar.ViewModels.Signing +{ + public partial class DocSigning : ContentPage + { + public DocSigning() + { + InitializeComponent(); + } + } +} diff --git a/BookAStar/BookAStar/ViewModels/Signing/SignaturePadConfigViewModel.cs b/BookAStar/BookAStar/ViewModels/Signing/SignaturePadConfigViewModel.cs new file mode 100644 index 00000000..8ccd7023 --- /dev/null +++ b/BookAStar/BookAStar/ViewModels/Signing/SignaturePadConfigViewModel.cs @@ -0,0 +1,160 @@ +using Xamarin.Forms; +using System.Windows.Input; +using XLabs.Forms.Mvvm; + +namespace BookAStar.ViewModels.Signing +{ + using Model.Settings; + public class SignaturePadConfigViewModel : ViewModel + { + private readonly ICommand isConfiguringCommand; + private bool isConfiguring; + + private string captionText; + private string clearText; + private string promptText; + private int strokeWidth; + + private Color captionTextColor; + private Color clearTextColor; + private Color promptTextColor; + private Color signaturePadBackground; + private Color signatureLineColor; + private Color strokeColor; + + public SignaturePadConfigViewModel() + { + isConfiguringCommand = new Command(() => IsConfiguring = !IsConfiguring); + } + + public ICommand ConfigureCommand => isConfiguringCommand; + + public bool IsConfiguring + { + get { return isConfiguring; } + set { SetProperty(ref isConfiguring, value); } + } + + public string CaptionText + { + get { return captionText; } + set { SetProperty(ref captionText, value); } + } + + public string ClearText + { + get { return clearText; } + set { SetProperty(ref clearText, value); } + } + + public string PromptText + { + get { return promptText; } + set { SetProperty(ref promptText, value); } + } + + public Color CaptionTextColor + { + get { return captionTextColor; } + set { if (SetProperty(ref captionTextColor, value)) + NotifyPropertyChanged(nameof(CaptionTextColorIndex)); } + } + + public Color ClearTextColor + { + get { return clearTextColor; } + set { if (SetProperty(ref clearTextColor, value)) + NotifyPropertyChanged(nameof(ClearTextColorIndex)); } + } + + public Color PromptTextColor + { + get { return promptTextColor; } + set { if (SetProperty(ref promptTextColor, value)) + NotifyPropertyChanged(nameof(PromptTextColorIndex)); } + } + + public Color SignaturePadBackground + { + get { return signaturePadBackground; } + set { if (SetProperty(ref signaturePadBackground, value)) + NotifyPropertyChanged(nameof(SignaturePadBackgroundIndex)); } + } + + public Color SignatureLineColor + { + get { return signatureLineColor; } + set { if (SetProperty(ref signatureLineColor, value)) + NotifyPropertyChanged(nameof(SignatureLineColorIndex)); } + } + + public Color StrokeColor + { + get { return strokeColor; } + set { if (SetProperty(ref strokeColor, value)) + NotifyPropertyChanged(nameof(StrokeColorIndex)); } + } + + public int StrokeWidth + { + get { return strokeWidth; } + set { SetProperty(ref strokeWidth, value); } + } + + public int CaptionTextColorIndex + { + get { return SignatureSettings.Colors.IndexOf(CaptionTextColor); } + set { CaptionTextColor = SignatureSettings.Colors[value]; } + } + + public int ClearTextColorIndex + { + get { return SignatureSettings.Colors.IndexOf(ClearTextColor); } + set { ClearTextColor = SignatureSettings.Colors[value]; } + } + + public int PromptTextColorIndex + { + get { return SignatureSettings.Colors.IndexOf(PromptTextColor); } + set { PromptTextColor = SignatureSettings.Colors[value]; } + } + + public int SignaturePadBackgroundIndex + { + get { return SignatureSettings.Colors.IndexOf(SignaturePadBackground); } + set { SignaturePadBackground = SignatureSettings.Colors[value]; } + } + + public int SignatureLineColorIndex + { + get { return SignatureSettings.Colors.IndexOf(SignatureLineColor); } + set { SignatureLineColor = SignatureSettings.Colors[value]; } + } + + public int StrokeColorIndex + { + get { return SignatureSettings.Colors.IndexOf(StrokeColor); } + set { StrokeColor = SignatureSettings.Colors[value]; } + } + public override void OnViewAppearing() + { + IsConfiguring = true; + + CaptionText = "signez ici"; + ClearText = "éffacer"; + PromptText = ">"; + StrokeWidth = 2; + + CaptionTextColor = Color.Gray; + ClearTextColor = Color.Gray; + PromptTextColor = Color.Gray; + SignaturePadBackground = Color.Yellow; + SignatureLineColor = Color.Black; + StrokeColor = Color.Black; + + base.OnViewAppearing(); + } + + } +} + diff --git a/BookAStar/BookAStar/ViewModels/UserProfile/UserLoginViewModel.cs b/BookAStar/BookAStar/ViewModels/UserProfile/UserLoginViewModel.cs new file mode 100644 index 00000000..1ee6b2f0 --- /dev/null +++ b/BookAStar/BookAStar/ViewModels/UserProfile/UserLoginViewModel.cs @@ -0,0 +1,10 @@ +using XLabs.Forms.Mvvm; + +namespace BookAStar.ViewModels.UserProfile +{ + class UserLoginViewModel : ViewModel + { + public string UserName { get; set; } + public string Password { get; set; } + } +} diff --git a/BookAStar/BookAStar/packages.config b/BookAStar/BookAStar/packages.config index 30635333..7e71283d 100644 --- a/BookAStar/BookAStar/packages.config +++ b/BookAStar/BookAStar/packages.config @@ -11,6 +11,7 @@ +