Exemplo n.º 1
0
 public WelcomePage()
 {
     InitializeComponent();
     welcomePage = new WelcomePageViewModel();
     //BindingContext = new WelcomePageViewModel();
     BindingContext = welcomePage;
 }
Exemplo n.º 2
0
 public WelcomePage()
 {
     NavigationPage.SetHasNavigationBar(this, true);
     InitializeComponent();
     welcomePageViewModel = AppContainer.Container.Resolve <WelcomePageViewModel>();
     BindingContext       = welcomePageViewModel;
 }
        public WelcomePage()
        {
            InitializeComponent();
            vm = this.DataContext as WelcomePageViewModel;

            vm.LoginEvent    += Login;
            vm.RegisterEvent += Register;
        }
Exemplo n.º 4
0
        public WelcomePage()
        {
            this.InitializeComponent();

            viewModel = new WelcomePageViewModel();

            Initialize();
        }
        public ActionResult Index()
        {
            var CurrentMonth = DateTime.Now.Month;

            var userId    = User.Identity.GetUserId();
            var ViewModel = new WelcomePageViewModel();

            var WorkoutList = _unitOfWork.Workouts.GetAllWorkouts(userId).ToList();

            ViewModel.Workouts = WorkoutList.Where(c => c.Date.Month == CurrentMonth).ToList();

            foreach (var item in ViewModel.Workouts)
            {
                ViewModel.LengthOfWorkoutSum += Convert.ToInt32(item.LengthOfTraining);
                ViewModel.VolumeSum          += item.WorkoutVolume;
            }

            ViewModel.VolumeSum /= 1000;

            var CardioList = _unitOfWork.Cardios.GetAllCardios(userId).ToList();

            ViewModel.Cardios = CardioList.Where(c => c.Date.Month == CurrentMonth).ToList();

            foreach (var item in ViewModel.Cardios)
            {
                ViewModel.LengthOfCardioSum += Convert.ToInt32(item.LengthOfTraining);
                ViewModel.DistanceSum       += item.Distance;
            }

            int Licznik, EnumCount = 0, MaxEnum = 0;

            for (int i = 0; i < ViewModel.Cardios.Count(); i++)
            {
                Licznik = 0;
                for (int j = 0; j < ViewModel.Cardios.Count(); j++)
                {
                    if (Convert.ToInt32(ViewModel.Cardios[j].CardioType) == Convert.ToInt32(ViewModel.Cardios[i].CardioType))
                    {
                        Licznik++;
                    }
                }
                if (Licznik > EnumCount)
                {
                    EnumCount = Licznik;
                    MaxEnum   = Convert.ToInt32(ViewModel.Cardios[i].CardioType);
                }
            }
            ViewModel.MostCardioType = (CardioType)MaxEnum;

            ViewModel.RuningBestDistance = CardioList.Where(f => f.CardioType == CardioType.Bieganie).OrderByDescending(c => c.Distance).FirstOrDefault();
            ViewModel.RuningLongestTime  = CardioList.Where(f => f.CardioType == CardioType.Bieganie).OrderByDescending(c => c.LengthOfTraining).FirstOrDefault();

            ViewModel.WorkoutBestVolume     = WorkoutList.OrderByDescending(w => w.WorkoutVolume).FirstOrDefault();
            ViewModel.WorkoutLongestTrening = WorkoutList.OrderByDescending(w => w.LengthOfTraining).FirstOrDefault();

            return(View(ViewModel));
        }
 public WelcomePage()
 {
     InitializeComponent();
     VM          = new WelcomePageViewModel();
     VM.Sections = new ObservableCollection <Section>
     {
         new Section
         {
             Header  = "Thank you for participating in the CarouselView Challenge!",
             Content = new FormattedString
             {
                 Spans =
                 {
                     new Span
                     {
                         Text =
                             "Your feedback is highly valuable for helping to drive CarouselView's development and highlight functionality you need most." +
                             Environment.NewLine + Environment.NewLine
                     },
                     new Span
                     {
                         Text           = "(This is a CarouselView, so swipe to the left to keep reading!)",
                         FontAttributes = FontAttributes.Italic
                     }
                 }
             }
         },
         new Section
         {
             Header  = "What to Do",
             Content = new FormattedString
             {
                 Spans =
                 {
                     new Span
                     {
                         Text = "Pick an app and reproduce a part of it where you can use the CarouselView." +
                                Environment.NewLine + Environment.NewLine
                     },
                     new Span
                     {
                         Text =
                             "This could be part of an app you've developed using Xamarin.Forms, or anything you'd like. Your choice!"
                     }
                 }
             }
         },
         new Section
         {
             Header  = "Create a PR and Give Feedback",
             Content = new FormattedString
             {
                 Spans =
                 {
                     new Span
                     {
                         Text =
                             "When you're finished, open a PR with your work, and feel free to share screenshots." +
                             Environment.NewLine + Environment.NewLine
                     },
                     new Span
                     {
                         Text =
                             "If you participated in the CollectionView Challenge, you'll be familiar with the feedback we'd like you to provide:"
                     }
                 }
             }
         },
         new Section
         {
             Header  = "1. What went well?",
             Content = new FormattedString
             {
                 Spans =
                 {
                     new Span
                     {
                         Text =
                             "Was the CarouselView easy to use? Were you able to accomplish what you set out to?" +
                             Environment.NewLine + Environment.NewLine
                     }
                 }
             },
             Emoji = "😀"
         },
         new Section
         {
             Header  = "2. What didn't go well?",
             Content = new FormattedString
             {
                 Spans =
                 {
                     new Span
                     {
                         Text = "Be as honest and detailed as possible." + Environment.NewLine +
                                Environment.NewLine
                     }
                 }
             },
             Emoji = "🙁"
         },
         new Section
         {
             Header  = "3. What's missing?",
             Content = new FormattedString
             {
                 Spans =
                 {
                     new Span
                     {
                         Text =
                             "Let us know about any functionality you didn't have access to and its impact on you, or anything else you'd like to see." +
                             Environment.NewLine + Environment.NewLine
                     }
                 }
             },
             Emoji = "🤔"
         },
     };
     BindingContext = VM;
 }
Exemplo n.º 7
0
 public WelcomePage(WelcomePageViewModel vm) : this()
 {
     this.DataContext = vm;
 }
Exemplo n.º 8
0
        public WelcomePage()
        {
            InitializeComponent();

            DataContext = new WelcomePageViewModel(this);
        }
Exemplo n.º 9
0
        public WelcomePage()
        {
            InitializeComponent();

            BindingContext = viewModel = new WelcomePageViewModel();
        }
        public IActionResult WelcomePage()
        {
            WelcomePageViewModel vm = new WelcomePageViewModel();

            return(View(vm));
        }
Exemplo n.º 11
0
 public WelcomePage()
 {
     InitializeComponent();
     ViewModel = new WelcomePageViewModel(new PageService());
 }
Exemplo n.º 12
0
 public HomeScreenViewModel(WelcomePageViewModel welcomePage, IPipeListener pipeListener,
                            Func <Stream, LogViewModel> modelCreator)
 {
     Pages.Add(welcomePage);
     pipeListener.NewClientConnection += (_, e) => Pages.Add(modelCreator(e.ClientConnection));
 }
Exemplo n.º 13
0
        public welcome_page2()
        {
            InitializeComponent();

            BindingContext = new WelcomePageViewModel();
        }
 public WelcomePage()
 {
     _viewModel       = new WelcomePageViewModel();
     this.DataContext = _viewModel;
     this.InitializeComponent();
 }