This file contains 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; | |
using System.IO; | |
using SQLite; | |
namespace DataPersistence.Sqlite.Database.Private | |
{ | |
/// <summary> | |
/// DatabaseAccess - Accesses the SQLite Database | |
/// </summary> |
This file contains 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 SQLite; | |
namespace DataPersistence.Sqlite.Database.Private | |
{ | |
public interface IDatabaseAccess | |
{ | |
/// <summary> | |
/// Returns a connection to the sqlite database | |
/// </summary> | |
/// <returns></returns> |
This file contains 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
<StackLayout VerticalOptions="Center" Padding="20,0"> | |
<Label Text="{Binding RedirectUrl}" HorizontalOptions="Center"/> | |
<Button Text="Get Redirect Url" Command="{Binding GetValueCommand}"/> | |
<BoxView HeightRequest="20" Color="Transparent"/> | |
<Entry Placeholder="Update Redirect Url" Text="{Binding UpdatedValue}"/> | |
<Button Text="Update" Command="{Binding UpdateValueCommand}"/> | |
</StackLayout> |
This file contains 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 MainPageViewModel() | |
{ | |
_appSettings = new AppSettings(); | |
GetValueCommand = new Command(OnGetValue); | |
UpdateValueCommand = new Command(OnUpdateValue); | |
_redirectUrl = "Press to get redirect url"; | |
} |
This file contains 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
#region Properties | |
public ICommand GetValueCommand { get; private set; } | |
public ICommand UpdateValueCommand { get; private set; } | |
#endregion Properties | |
#region OnCommand Methods | |
private void OnGetValue() |
This file contains 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
#region Properties | |
private string _redirectUrl; | |
public string RedirectUrl | |
{ | |
get => _redirectUrl; | |
} | |
private string _updatedValue; | |
public string UpdatedValue |
This file contains 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
#region Properties | |
private IAppSettings _appSettings; | |
#endregion Properties |
This file contains 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" | |
xmlns:local="clr-namespace:DataPersistence.Properties.Views" | |
xmlns:viewModels="clr-namespace:DataPersistence.Properties.ViewModels" | |
x:Class="DataPersistence.Properties.Views.MainPage"> | |
<ContentPage.BindingContext> | |
<viewModels:MainPageViewModel/> | |
</ContentPage.BindingContext> | |
... |
This file contains 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
#endregion OnCommand Methods | |
#region PropertyChanged Methods | |
public event PropertyChangedEventHandler PropertyChanged; | |
protected virtual void OnPropertyChanged(string propertyName) | |
{ | |
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | |
} |
This file contains 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 class MainPageViewModel : INotifyPropertyChanged | |
{ | |
... | |
} |
NewerOlder