public SubmitFeedbackViewModel(PlaySession playsession, RequestCreator requestCreator, INavigation navigation) : base(requestCreator, navigation)
 {
     Feedback.PlaySession = playsession;
 }
 public LoginPageViewModel(RequestCreator requestCreator, INavigation navigation) : base(requestCreator,
                                                                                         navigation)
 {
 }
 public ForgotPasswordViewModel(RequestCreator requestCreator, INavigation navigation) : base(requestCreator,
                                                                                              navigation)
 {
 }
 public BasePage(RequestCreator requestCreator)
 {
     RequestCreator = requestCreator;
 }
        public CreateFocusPointPopupViewModel(bool canCreatePrivateFocusPoint, FocusPointDescriptor fp, RequestCreator requestCreator, INavigation navigation) : this(canCreatePrivateFocusPoint, requestCreator, navigation)
        {
            FocusPoint = new FocusPointDescriptor
            {
                Name        = fp.Name,
                Id          = fp.Id,
                Description = fp.Description,
                VideoURL    = fp.VideoURL,
            };

            isEdit = true;
        }
 //Edit mode for PracticeSession
 public CreatePracticePage(PracticeSession ps, RequestCreator requestCreator) : base(requestCreator)
 {
     Init(() => new CreatePracticeViewModel(ps, requestCreator, Navigation));
     SetExercises();
 }
 //Constructor uses date from today
 public CreatePracticePage(RequestCreator requestCreator) : this(DateTime.Today, requestCreator)
 {
 }
예제 #8
0
        public override bool TryGetValue(IEnumerable <IMvxSourceStep> steps, out object value)
        {
            //Enumerate the list
            var list = steps?.ToList();

            if (list == null)
            {
                value = null;
                return(false);
            }

            RequestCreator requestCreator = null;
            var            resourceToLoad = list.First().GetValue();
            var            resourceType   = resourceToLoad.GetType();

            //Load appropriate type
            if (resourceType == typeof(string))
            {
                requestCreator = Picasso.Load((string)resourceToLoad);
            }
            else if (resourceType == typeof(int))
            {
                requestCreator = Picasso.Load((int)resourceToLoad);
            }
            else if (resourceType == typeof(string))
            {
                requestCreator = Picasso.Load((string)resourceToLoad);
            }
            else if (resourceType == typeof(string))
            {
                requestCreator = Picasso.Load((string)resourceToLoad);
            }
            else
            {
                value = null;
                return(false);
            }

            //Skip the initial value and get only valid strings as options
            foreach (var option in list?.Skip(1).Select(x => x.GetValue()).OfType <string>())
            {
                switch (option)
                {
                case Fit:
                    requestCreator = requestCreator.Fit();
                    break;

                case CenterCrop:
                    requestCreator = requestCreator.CenterCrop();
                    break;

                case CenterInside:
                    requestCreator = requestCreator.CenterInside();
                    break;

                case MemoryPolicyNoCache:
                    requestCreator = requestCreator.MemoryPolicy(MemoryPolicy.NoCache);
                    break;

                case MemoryPolicyNoStore:
                    requestCreator = requestCreator.MemoryPolicy(MemoryPolicy.NoStore);
                    break;

                case NetworkPolicyNoCache:
                    requestCreator = requestCreator.NetworkPolicy(NetworkPolicy.NoCache);
                    break;

                case NetworkPolicyNoStore:
                    requestCreator = requestCreator.NetworkPolicy(NetworkPolicy.NoStore);
                    break;

                case NoFade:
                    requestCreator = requestCreator.NoFade();
                    break;

                case NoPlaceholder:
                    requestCreator = requestCreator.NoPlaceholder();
                    break;

                case OnlyScaleDown:
                    requestCreator = requestCreator.OnlyScaleDown();
                    break;

                case PriorityHigh:
                    requestCreator = requestCreator.Priority(Square.Picasso.Picasso.Priority.High);
                    break;

                case PriorityNormal:
                    requestCreator = requestCreator.Priority(Square.Picasso.Picasso.Priority.Normal);
                    break;

                case PriorityLow:
                    requestCreator = requestCreator.Priority(Square.Picasso.Picasso.Priority.Low);
                    break;

                case CircleTransform:
                    requestCreator = requestCreator.Transform(new CircleTransform());
                    break;

                default:

                    if (option.StartsWith(Placeholder, System.StringComparison.Ordinal))
                    {
                        var parameters = GetParametersFromString <int>(Placeholder, option).ToList();
                        if (parameters.Count != 1)
                        {
                            continue;
                        }
                        requestCreator = requestCreator.Placeholder(parameters.Single());
                    }
                    else if (option.StartsWith(Error, System.StringComparison.Ordinal))
                    {
                        var parameters = GetParametersFromString <int>(Error, option).ToList();
                        if (parameters.Count != 1)
                        {
                            continue;
                        }
                        requestCreator = requestCreator.Error(parameters.Single());
                    }
                    else if (option.StartsWith(Resize, System.StringComparison.Ordinal))
                    {
                        var parameters = GetParametersFromString <int>(Resize, option).ToList();
                        if (parameters.Count != 2)
                        {
                            continue;
                        }
                        requestCreator = requestCreator.Resize(parameters[0], parameters[1]);
                    }
                    else if (option.StartsWith(ResizeDimen, System.StringComparison.Ordinal))
                    {
                        var parameters = GetParametersFromString <int>(ResizeDimen, option).ToList();
                        if (parameters.Count != 2)
                        {
                            continue;
                        }
                        requestCreator = requestCreator.ResizeDimen(parameters[0], parameters[1]);
                    }
                    else if (option.StartsWith(Rotate, System.StringComparison.Ordinal))
                    {
                        var parameters = GetParametersFromString <int>(Rotate, option).ToList();

                        if (parameters.Count == 3)
                        {
                            requestCreator = requestCreator.Rotate(parameters[0], parameters[1], parameters[2]);
                        }
                        else if (parameters.Count == 1)
                        {
                            requestCreator = requestCreator.Rotate(parameters[0]);
                        }
                    }
                    else if (option.StartsWith(Transform, System.StringComparison.Ordinal))
                    {
                        var parameters = GetParametersFromString <int>(Transform, option).ToList();
                        if (parameters.Count != 1)
                        {
                            continue;
                        }
                        requestCreator = requestCreator.Placeholder(parameters.Single());
                    }

                    break;
                }
            }

            value = requestCreator;
            return(true);
        }
예제 #9
0
 public BaseViewModel(RequestCreator requestCreator, INavigation navigation)
 {
     RequestCreator = requestCreator;
     Navigation     = navigation;
 }
 public BaseMasterDetailPage(RequestCreator requestCreator)
 {
     RequestCreator = requestCreator;
 }