Ejemplo n.º 1
0
        private void InitializeDefaultProperties()
        {
            _originalCollection  = new List <FavoritedAnime>();
            _settingsPreferences = App.liteDB.GetCollection <SettingsPreferences>().FindById(0);


            ResetSearchConfig(_settingsPreferences.ShowNSFW, AnimeSearchSortable.Score, SortDirection.Descending);

            IsSearchVisible = false;

            Animes = new ObservableRangeCollection <FavoritedAnime>();

            SelectionModeCommand = new magno.Command(OnSelectionMode);
            AddToFavoriteCommand = new magno.AsyncCommand(OnAddToFavorite);
            ClearTextCommand     = new magno.Command(OnClearText);
            SearchCommand        = new magno.AsyncCommand(OnSearch);
            OpenSearchCommand    = new magno.Command(OnOpenSearch);
            OpenAnimeCommand     = new magno.AsyncCommand(OnOpenAnime);
            LoadMoreCommand      = new magno.AsyncCommand(OnLoadMore);
            ObjectCheckedCommand = new magno.Command <ICheckableObject>(OnObjectChecked);
            ApplyFilterCommand   = new magno.AsyncCommand(OnApplyFilter);
            ResetFilterCommand   = new magno.AsyncCommand(OnResetFilter);
            BackButtonCommand    = new magno.AsyncCommand <CatalogueView>(OnBackButton);
            ChangeSeasonCommand  = new magno.AsyncCommand(OnChangeSeason);
        }
 public EditMusicianViewModel()
 {
     Title              = "Editovat muzikanta";
     SaveCommand        = new AsyncCommand(Save);
     PickPhotoCommand   = new AsyncCommand(PickPhoto);
     DeletePhotoCommand = new Command(DeletePhoto);
 }
Ejemplo n.º 3
0
        //TODO: https://github.com/JaoHundred/ANT/issues/80

        public ProgressPopupViewModel(object collection, BaseViewModel viewModelType)
        {
            _cancelationToken    = new CancellationTokenSource();
            _collection          = collection;
            _viewModelType       = viewModelType;
            InitializeTask       = LoadAsync(null);
            CancelProcessCommand = new magno.Command(OnCancel);
        }
Ejemplo n.º 4
0
        public WelcomePageViewModel()
        {
            Title       = "Your Smart Home";
            devicesList = new ObservableCollection <SensorDevice>();
            GetMainDevice();

            RefreshButton = new MvvmHelpers.Commands.Command(Refresh);
        }
Ejemplo n.º 5
0
        public AnimeCharacterViewModel(long characterId)
        {
            InitializeTask = LoadAsync(characterId);

            FavoriteCommand     = new magno.Command(OnFavorite);
            OpenLinkCommand     = new magno.AsyncCommand <string>(OpenLink);
            SelectedItemCommand = new magno.AsyncCommand(OnSelectedItem);
        }
Ejemplo n.º 6
0
        public VoiceActorViewModel(long malId)
        {
            InitializeTask = LoadAsync(malId);

            FavoriteCommand          = new magno.Command(OnFavorite);
            SelectedAnimeCommand     = new magno.AsyncCommand <MALImageSubItem>(OnSelectedAnime);
            SelectedCharacterCommand = new magno.AsyncCommand <MALImageSubItem>(OnSelectedCharacter);
            OpenLinkCommand          = new magno.AsyncCommand <string>(OpenLink);
        }
Ejemplo n.º 7
0
 public EditBandViewModel()
 {
     Title              = "Editovat skupinu";
     SaveCommand        = new AsyncCommand(Save);
     Genres             = new ObservableRangeCollection <Genre>();
     ItemList           = new ObservableRangeCollection <SelectableItem>();
     PickPhotoCommand   = new AsyncCommand(PickPhoto);
     DeletePhotoCommand = new Command(DeletePhoto);
 }
Ejemplo n.º 8
0
 public MusicianListViewModel()
 {
     Title                = "Seznam muzikantů";
     Musicians            = new ObservableRangeCollection <Musician>();
     RefreshCommand       = new AsyncCommand(Refresh);
     SelectedCommand      = new AsyncCommand(Selected);
     LoadMoreCommand      = new Command(LoadMore);
     ClearCommand         = new Command(Clear);
     DelayLoadMoreCommand = new Command(DelayLoadMore);
 }
Ejemplo n.º 9
0
        public PanierViewModel()
        {
            Item     = DataManager.GetpanNConcl();
            ItemsPan = new ObservableRangeCollection <ItemPan>();
            ItemsPan.AddRange(Item.ItemsPan);

            Title = $"Pr N° {Item.Id:000}";

            RemoveProductCommand = new MvvmHelpers.Commands.Command(async(object obj) => await RemoveProduct(obj as ItemPan));
            FinalCommand         = new AsyncCommand(Final);
        }
Ejemplo n.º 10
0
        public FavoriteCharacterViewModel()
        {
            ClearAllRecentCommand           = new magno.AsyncCommand(OnClearAllRecent);
            OpenCharacterCommand            = new magno.AsyncCommand(OnOpenCharacter);
            DeleteFavoriteCommand           = new magno.AsyncCommand(OnDeleteFavorite);
            ClearTextCommand                = new magno.Command(OnClearText);
            SearchCommand                   = new magno.AsyncCommand(OnSearch);
            SelectionModeCommand            = new magno.Command(OnSelectionMode);
            UpdateFavoriteCharactersCommand = new magno.AsyncCommand(OnUpdateFavoriteCharacters);

            FavoritedCharacters = new ObservableRangeCollection <FavoritedAnimeCharacter>();
        }
Ejemplo n.º 11
0
        public FavoriteVoiceActorViewModel()
        {
            ClearAllRecentCommand            = new magno.AsyncCommand(OnClearAllRecent);
            OpenVoiceActorCommand            = new magno.AsyncCommand(OnOpenVoiceActor);
            DeleteFavoriteCommand            = new magno.AsyncCommand(OnDeleteFavorite);
            ClearTextCommand                 = new magno.Command(OnClearText);
            SearchCommand                    = new magno.AsyncCommand(OnSearch);
            SelectionModeCommand             = new magno.Command(OnSelectionMode);
            UpdateFavoriteVoiceActorsCommand = new magno.AsyncCommand(OnUpdateFavoriteVoiceActors);

            FavoritedActors = new ObservableRangeCollection <FavoritedVoiceActor>();
        }
Ejemplo n.º 12
0
 public UserBandsViewModel()
 {
     Title           = "Seznam skupin spravovaných uživatelem";
     Bands           = new ObservableRangeCollection <Band>();
     RefreshCommand  = new AsyncCommand(Refresh);
     SelectedCommand = new AsyncCommand(Selected);
     ClearCommand    = new Command(Clear);
     AddCommand      = new AsyncCommand(Add);
     EditCommand     = new AsyncCommand <Band>(Edit);
     RemoveCommand   = new AsyncCommand <Band>(Remove);
     MembersCommand  = new AsyncCommand <Band>(Members);
 }
Ejemplo n.º 13
0
 public BandListViewModel()
 {
     Title                = "Seznam skupin";
     Bands                = new ObservableRangeCollection <Band>();
     RefreshCommand       = new AsyncCommand(Refresh);
     SelectedCommand      = new AsyncCommand(Selected);
     LoadMoreCommand      = new Command(LoadMore);
     ClearCommand         = new Command(Clear);
     AddCommand           = new AsyncCommand(Add);
     EditCommand          = new AsyncCommand <Band>(Edit);
     RemoveCommand        = new AsyncCommand <Band>(Remove);
     DelayLoadMoreCommand = new Command(DelayLoadMore);
 }
Ejemplo n.º 14
0
        public CurrentGoalViewModel()
        {
            PopulateGoalDetails();

            AddTaskCommand = new MvvmHelpers.Commands.Command(AddTasks);

            Tasks = new ObservableRangeCollection <GoalsTasks>();

            _ = LoadTasks();
            RefreshCommand = new AsyncCommand(Refresh);

            RemoveCommand = new AsyncCommand <GoalsTasks>(Remove);

            BackToMainPageCommand = new MvvmHelpers.Commands.Command(BackToMainPages);
        }
        public CoffeeEquipmentViewModel()
        {
            Title = "Coffee Equipment";

            Coffee       = new ObservableRangeCollection <Coffee>();
            CoffeeGroups = new ObservableRangeCollection <Grouping <string, Coffee> >();
            LoadMore();

            RefreshCommand       = new AsyncCommand(Refresh);
            FavoriteCommand      = new AsyncCommand <Coffee>(Favorite);
            SelectedCommand      = new AsyncCommand <object>(Selected);
            LoadMoreCommand      = new Command(LoadMore);
            ClearCommand         = new Command(Clear);
            DelayLoadMoreCommand = new Command(DelayLoadMore);
        }
        public GoalsOverviewViewModel()
        {
            PopulateGoalDetails();

            AddGoalCommand = new MvvmHelpers.Commands.Command(AddGoals);

            SelectedCommand = new AsyncCommand <object>(Selected);

            Goals = new ObservableRangeCollection <Goal>();

            _ = LoadGoals();
            RefreshCommand = new AsyncCommand(Refresh);

            RemoveCommand = new AsyncCommand <Goal>(Remove);
        }
        public ClientsViewModel()
        {
            Title = "Clients";

            Client = new ObservableRangeCollection <Client>();

            _ = LoadClients();

            SelectedCommand = new AsyncCommand <object>(Selected);

            RefreshCommand = new AsyncCommand(Refresh);

            AddClientCommand = new MvvmHelpers.Commands.Command(Add);

            RemoveCommand = new AsyncCommand <Client>(Remove);
        }
        public EchipamenteCafeaViewModel()
        {
            Title = " Ecchipament Cafea";

            Cafea     = new ObservableRangeCollection <Cafea>();
            GrupCafea = new ObservableRangeCollection <Grouping <string, Cafea> >();


            LoadMore();

            RefreshCommand       = new AsyncCommand(Refresh);
            SelectedCommand      = new AsyncCommand <object>(Selected);
            FavoriteCommand      = new AsyncCommand <Cafea>(Favorite);
            ClearCommand         = new Command(Clear);
            DelayLoadMoreCommand = new Command(DelayLoadMore);
            LoadMoreCommand      = new Command(LoadMore);
        }
Ejemplo n.º 19
0
        public FavoriteAnimeViewModel()
        {
            GroupedFavoriteByWeekList = new ObservableRangeCollection <GroupedFavoriteAnimeByWeekDay>();

            SearchCommand               = new magno.AsyncCommand(OnSearch);
            ClearTextCommand            = new magno.Command(OnClearText);
            DeleteFavoriteCommand       = new magno.AsyncCommand(OnDeleteFavoriteCommand);
            ArchiveFavoriteCommand      = new magno.AsyncCommand(OnArchiveFavorite);
            ClearAllCommand             = new magno.AsyncCommand(OnClearAll);
            SelectionModeCommand        = new magno.Command(OnSelectionMode);
            OpenAnimeCommand            = new magno.AsyncCommand(OnOpenAnime);
            ObjectCheckedCommand        = new magno.Command <ICheckableObject>(OnObjectChecked);
            ApplyFilterCommand          = new magno.AsyncCommand(OnApplyFilter);
            ResetFilterCommand          = new magno.Command(OnResetFilter);
            SwitchCommand               = new Xamarin.Forms.Command <FavoritedAnime>(OnSwitch);
            StepperCommand              = new Xamarin.Forms.Command <FavoritedAnime>(OnStepper);
            UpdateFavoriteAnimesCommand = new AsyncCommand(OnUpdateAnimes);
        }
Ejemplo n.º 20
0
        public TimerViewModel(string id, bool bootStart = false, float bootMins = -1)
        {
            platformHelpers = ServiceContainer.Resolve <IPlatformHelpers>();
            identifier      = id;
            settings        = new Settings(id);
            this.bootMins   = bootMins;

            InitializeFile();

            switch (identifier)
            {
            case Constants.Giveaway:
            case Constants.Countdown2:
            case Constants.Countdown3:
            case Constants.Countdown:
                IsDown = true;
                break;

            case Constants.Countup:
                IsDown = false;
                break;
            }

            StartStopTimerCommand   = new Command(() => ExecuteStartStopTimerCommand(true));
            CopyFilePathCommand     = new AsyncCommand(ExecuteCopyFilePathCommand);
            ResetCommand            = new Command(ExecuteResetCommand);
            AddMinuteCommand        = new Command(ExecuteAddMinuteCommand);
            PauseResumeTimerCommand = new Command(ExecutePauseResumeTimerCommand);
            timer           = new Timer(800);
            timer.Elapsed  += TimerElapsed;
            timer.AutoReset = true;

            if (AutoStart || bootStart)
            {
                ExecuteStartStopTimerCommand();
            }
        }
Ejemplo n.º 21
0
        public ProjectsViewModel()
        {
            Title = "Projects";

            /* Коллекция хранит в себе все проекты, которые были созданы. Управление этими проектами происходит тоже
             * с помощью этой коллекции*/

            Projects      = new ObservableRangeCollection <Project>();
            ActiveProject = new List <Project>();

            var range = new List <Project>(App.DBProjects.GetItems());

            /*List<Project> newRange = new List<Project>();
             * foreach (var p in range)
             * {
             *  newRange.Add(new Project(p));
             * }
             */
            Projects.AddRange(range);

            RecoverGlobalTimer();

            /* команды для управления коллекцией проектов, которые будут привязаны к кнопкам на главной странице
             * каждая команда имеет свою функцию (которая указана в скобках), которая будет вызвана и исполнена с теми параметрами, которые
             * ей будут переданы, например для создания нового проекта будет совершен переход на новую страницу с
             * пустым проектом*/


            CreateProjectCommand = new MvvmHelpers.Commands.Command(CreateProject);
            ManageProjectCommand = new MvvmHelpers.Commands.Command(ManageProject);
            EditTimeCommand      = new MvvmHelpers.Commands.Command(EditTime);
            ToggleTimerCommand   = new MvvmHelpers.Commands.Command(ToggleTimer);

            MessagingCenter.Subscribe <Project>(this, "MsgSaveProject", (project) =>
            {
                ExecuteUpdateProject(project);
                Application.Current.MainPage.DisplayAlert("Info", "Changes Saved!", "OK");
            });

            MessagingCenter.Subscribe <Project>(this, "MsgUpdateLastSyncProject", (project) =>
            {
                ExecuteUpdateLastSync(project);
            });

            MessagingCenter.Subscribe <Project>(this, "MsgCreateProject", (project) =>
            {
                App.DBProjects.SaveItem(project);
                Projects.Add(project);
            });
            MessagingCenter.Subscribe <Project>(this, "MsgDeleteProject", (project) =>
            {
                App.DBProjects.DeleteItem(project.Id);
                IsBusy = true;
                Task.Delay(1000).ContinueWith(t =>
                {
                    foreach (var p in Projects)
                    {
                        if (p.Id == project.Id)
                        {
                            Projects.Remove(p);
                        }
                    }
                });
                IsBusy = false;
            });

            MessagingCenter.Subscribe <Project>(this, "EditTimeMessage", (project) =>
            {
                ExecuteUpdateTime(project);
            });
        }
Ejemplo n.º 22
0
 public PostPageViewModel()
 {
     ShareCommand   = new MvvmHelpers.Commands.Command(SharePost);
     imgPickCommand = new AsyncCommand(imgpick);
 }
Ejemplo n.º 23
0
 public HomePageViewModel(INavigation navigation)
 {
     Navigation        = navigation;
     CreateGameCommand = new Command(CreateGame);
     JoinGameCommand   = new Command(JoinGame);
 }