mirror of
https://github.com/bitwarden/mobile
synced 2026-01-03 17:13:50 +00:00
Added tools extension page to help iOS users activate the action extension.
This commit is contained in:
47
src/App/Models/Page/AppExtensionPageModel.cs
Normal file
47
src/App/Models/Page/AppExtensionPageModel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace Bit.App.Models.Page
|
||||
{
|
||||
public class AppExtensionPageModel : INotifyPropertyChanged
|
||||
{
|
||||
private readonly ISettings _settings;
|
||||
|
||||
public AppExtensionPageModel(ISettings settings)
|
||||
{
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public bool Started
|
||||
{
|
||||
get { return _settings.GetValueOrDefault(Constants.ExtensionStarted, false); }
|
||||
set
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.ExtensionStarted, true);
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(Started)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(NotStarted)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(StartedAndNotActivated)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(StartedAndActivated)));
|
||||
}
|
||||
}
|
||||
|
||||
public bool Activated
|
||||
{
|
||||
get { return _settings.GetValueOrDefault(Constants.ExtensionActivated, false); }
|
||||
set
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.ExtensionActivated, value);
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(Activated)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(StartedAndNotActivated)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(StartedAndActivated)));
|
||||
}
|
||||
}
|
||||
|
||||
public bool NotStarted => !Started;
|
||||
public bool StartedAndNotActivated => Started && !Activated;
|
||||
public bool StartedAndActivated => Started && Activated;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user