public UserMilestonePage(RootPage root, ProfileEnhancedViewModel profileViewModel)
 {
     try
     {
         InitializeComponent();
         App.Configuration.InitialAsync(this);
         NavigationPage.SetHasNavigationBar(this, false);
         _media = DependencyService.Get <IMedia>();
         _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
         _model = new UserMilestoneViewModel(App.CurrentApp.MainPage.Navigation)
         {
             Root             = root,
             ProfileViewModel = profileViewModel,
             // CHANGED
             SliderCurrentWeight = sliderCurrentWeight,
             WeightLossGoal      = profileViewModel.YourGoal,
             UserTrackers        = profileViewModel.UserTrackers.OrderBy(t => t.ModifyDate).ToList(),
             UserMetas           = profileViewModel.UserDetail.MetaPivot
         };
         BindingContext = _model;
         _model.GetUserTracker();
         _model.ChangeSliderValue(0);
         Init();
     }
     catch (Exception ex)
     {
         ClientService.WriteLog(null, ex, true).GetAwaiter();
     }
 }
Ejemplo n.º 2
0
 public AudioPlayerViewModel(INavigation navigation = null) : base(navigation)
 {
     _localFile   = DependencyService.Get <ILocalFile>();
     _audioPlayer = DependencyService.Get <IAudioPlayerService>();
     _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
     SetPageImageSize();
     MediaFiles       = new List <MediaFile>();
     CurrentMediaFile = new MediaFile();
     PlayButton       = ImageResizer.ResizeImage(TextResources.icon_media_play, ButtonImageSize);
     PauseButton      = ImageResizer.ResizeImage(TextResources.icon_media_pause, ButtonImageSize);
     StopButton       = ImageResizer.ResizeImage(TextResources.icon_media_stop, ButtonImageSize);
     NextButton       = ImageResizer.ResizeImage(TextResources.icon_media_next, ButtonImageSize);
     PreviousButton   = ImageResizer.ResizeImage(TextResources.icon_media_previous, ButtonImageSize);
     PlayPauseButton  = PlayButton;
     IsPlaying        = false;
     IsPause          = false;
     IsMediaExists    = false;
     CurrentSongIndex = 0;
     CrossMediaManager.Current.PlayingChanged += async(sender, e) =>
     {
         CurrentPosition = e.Progress;
         CurrentTimer    = e.Position.ToString(@"hh\:mm\:ss");
         TotalTimer      = e.Duration.ToString(@"hh\:mm\:ss");
         double TOLERANCE = 0;
         if (Math.Abs(e.Progress - 1) < TOLERANCE)
         {
             await PlayCurrent(Next());
         }
     };
 }
        public AudioPlayerViewModel(INavigation navigation = null) : base(navigation)
        {
            _audioPlayerManager       = DependencyService.Get <IAudioPlayerManager>();
            _musicDictionary          = DependencyService.Get <IMusicDictionary>();
            _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
            SetPageImageSize();
            MusicFiles         = new List <MusicFile>();
            AllMusicFiles      = new List <MusicFile>();
            PlaylistMusicFiles = new List <MusicFile>();
            CurrentMusicFile   = new MusicFile();
            PlayButton         = ImageResizer.ResizeImage(TextResources.icon_media_play, ButtonImageSize);
            PauseButton        = ImageResizer.ResizeImage(TextResources.icon_media_pause, ButtonImageSize);
            StopButton         = ImageResizer.ResizeImage(TextResources.icon_media_stop, ButtonImageSize);
            NextButton         = ImageResizer.ResizeImage(TextResources.icon_media_next, ButtonImageSize);
            PreviousButton     = ImageResizer.ResizeImage(TextResources.icon_media_previous, ButtonImageSize);
            ForwardButton      = ImageResizer.ResizeImage(TextResources.icon_media_forward, ButtonImageSize);
            BackwardButton     = ImageResizer.ResizeImage(TextResources.icon_media_backward, ButtonImageSize);
            PlayPauseButton    = PlayButton;
            NowPlayingButton   = PlayButton;

            ChecklistImage    = ChecklistDefaultImage;
            SortImage         = SortDefaultImage;
            PlaylistTextStyle = PlaylistTextStyleDefault;
            PlaylistSortBy    = PlaylistSortList.Title;

            IsPlaying           = false;
            IsPause             = false;
            IsMediaExists       = false;
            CurrentSongIndex    = 0;
            IsLoopStarted       = false;
            IsPermissionGranted = false;
        }
Ejemplo n.º 4
0
 public StatisticServices()
 {
     _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
     _helper = DependencyService.Get <IHelper>();
     Allow();
     IsPermitted = true;
 }
Ejemplo n.º 5
0
 public AudioPlayerPage(RootPage rootPage)
 {
     try
     {
         InitializeComponent();
         _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
         Init(rootPage);
     }
     catch (Exception ex)
     {
         var exceptionHandler = new ExceptionHandler(TAG, ex);
     }
 }
Ejemplo n.º 6
0
 public MiscContentPage(RootPage root)
 {
     try
     {
         InitializeComponent();
         _model = new MiscContentViewModel()
         {
             Root = root
         };
         _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
         Init();
     }
     catch (Exception ex)
     {
         new ExceptionHandler(TAG, ClientService.GetExceptionDetail(ex));
     }
 }
Ejemplo n.º 7
0
        //private Plugin.Media.Abstractions.MediaFile _mediaFile;

        public AchievedMilestonePage(MilestoneViewModel model)
        {
            try
            {
                InitializeComponent();
                media = DependencyService.Get <IMedia>();
                _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
                _model         = model;
                BindingContext = _model;
                Initialization();
            }
            catch (Exception ex)
            {
                DependencyService.Get <IMessage>().AlertAsync(TextResources.Alert,
                                                              ex.InnerException != null ? ex.InnerException.Message : ex.Message, TextResources.Ok);
            }
        }
Ejemplo n.º 8
0
        private async void Init(object obj)
        {
            _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
            _model = new MenuPageViewModel(Navigation)
            {
                Title            = TextResources.XChallenge,
                Subtitle         = TextResources.XChallenge,
                Icon             = TextResources.icon_menu,
                Root             = (RootPage)obj,
                MenuBindCallback = MenuBind
            };
            BindingContext = this._model;
            _helper        = DependencyService.Get <IHelper>();
            await _model.GetMenuData();

            await _model.GetProfilePhoto();

            _metaPivotService = DependencyService.Get <IMetaPivotService>();
            _media            = DependencyService.Get <Globals.IMedia>();
        }
Ejemplo n.º 9
0
        public sealed override async void Init(object obj)
        {
            _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
            _model = new MenuGridViewModel(Navigation)
            {
                Title    = TextResources.XChallenge,
                Subtitle = TextResources.XChallenge,
                Icon     = TextResources.icon_menu,
                Root     = (RootPage)obj
            };
            BindingContext = this._model;
            _helper        = DependencyService.Get <IHelper>();
            GridMenu.ItemSelectedHandler += GridMenu_ItemSelectedHandler;
            await _model.BindMenuData();

            await _model.GetProfilePhoto();

            App.Configuration.IsMenuLoaded = true;
            _metaPivotService = DependencyService.Get <IMetaPivotService>();
            _media            = DependencyService.Get <Globals.IMedia>();
        }
Ejemplo n.º 10
0
 public UploadPhotoPage(UserFirstUpdate user, bool error = false, string message = "")
 {
     InitializeComponent();
     App.Configuration.InitialAsync(this);
     NavigationPage.SetHasNavigationBar(this, false);
     _media = DependencyService.Get <IMedia>();
     _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
     _model         = new UploadPhotoViewModel();
     _user          = user;
     BindingContext = _model;
     Initialization();
     _trackerPivotService = DependencyService.Get <ITrackerPivotService>();
     _helper = DependencyService.Get <IHelper>();
     if (error)
     {
         _model.SetActivityResource(showError: true,
                                    errorMessage: string.IsNullOrWhiteSpace(message.Trim())
                 ? message.Trim()
                 : _helper.ReturnMessage(message));
     }
 }
 public sealed override async void Init(object obj = null)
 {
     _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
     BindingContext            = _model;
     Initialization();
 }