/// <summary>
        /// Initializes a new instance of the <see cref="AboutWindow"/> class.
        /// </summary>
        /// <param name="viewModel">The view model to inject.</param>
        /// <remarks>
        /// This constructor can be used to use view-model injection.
        /// </remarks>
        public AboutWindow(AboutViewModel viewModel)
            : base(viewModel, DataWindowMode.Custom)
        {
            InitializeComponent();

            this.ApplyApplicationIcon();
        }
Exemple #2
0
        public AboutPage()
        {
            InitializeComponent();

            var viewModel = new AboutViewModel(Navigation);

            BindingContext = viewModel;
        }
        public IActionResult About()
        {
            var viewModel = new AboutViewModel();
            var user      = AccountService.GetAccountByUsername(User.Identity.Name);

            viewModel.user = user;
            return(View(viewModel));
        }
        public AboutViewModel CreateAboutViewModel()
        {
            AboutViewModel aboutViewModel = new AboutViewModel();

            aboutViewModel.Message = new MessageBaseViewModel();

            return(aboutViewModel);
        }
Exemple #5
0
        public ActionResult Delete(AboutViewModel viewModel)
        {
            var about = _dbContext.Abouts.Single(a => a.Id == viewModel.Id);

            _dbContext.Abouts.Remove(about);
            _dbContext.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #6
0
        public AboutView()
        {
            InitializeComponent();
            //  inicializa el ViewModel (deberia hacerlo con un inyector...)
            _viewModel = ViewModelSource.Create <AboutViewModel>();

            BindCommands();
        }
        public AboutWindow()
        {
            InitializeComponent();

            viewModel = new AboutViewModel();

            DataContext = viewModel;
        }
Exemple #8
0
 public SettingFlipViewModel()
 {
     this.CommonViewModel   = new CommonViewModel();
     this.EditorViewModel   = new EditorViewModel();
     this.ExtendedViewModel = new ExtendedViewModel();
     this.CompileViewModel  = new CompileViewModel();
     this.AboutViewModel    = new AboutViewModel();
 }
        public void Initialize()
        {
            networkOperations   = Substitute.For <NetworkOperations>();
            serviceControl      = Substitute.For <IServiceControl>();
            licenseRegistration = Substitute.For <LicenseRegistrationViewModel>();

            sut = new AboutViewModel(networkOperations, serviceControl, licenseRegistration);
        }
 private bool GetApiRateLimit(AboutViewModel model, Task <HttpWebResponse> responseTask)
 {
     // parse the X-RateLimit-Remaining HTTP header from the response
     using (HttpWebResponse response = responseTask.Result)
         model.RateLimitRemaining = int.Parse(response.Headers["X-RateLimit-Remaining"]);
     SetResult(View("About", model));
     return(true);
 }
        private Task <HttpWebResponse> MakeApiRequest(AboutViewModel model)
        {
            // get the root API URI, which will return the X-RateLimit-Remaining HTTP header
            Uri            uri     = new Uri("https://api.github.com");
            HttpWebRequest request = GitHubApi.CreateRequest(uri);

            return(request.GetHttpResponseAsync());
        }
        public IActionResult OnGet()
        {
            ViewModel = new AboutViewModel();

            SetAboutValues();

            return(Page());
        }
Exemple #13
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.fragment_about, container, false);

            ViewModel       = new AboutViewModel();
            learnMoreButton = view.FindViewById <Button>(Resource.Id.button_learn_more);
            return(view);
        }
Exemple #14
0
        public AboutPage()
        {
            this.InitializeComponent();

            var settingsViewModel = new AboutViewModel(this.Navigation);

            this.BindingContext = settingsViewModel;
        }
        public void Initialize()
        {
            networkOperations = Substitute.For<NetworkOperations>();
            serviceControl = Substitute.For<IServiceControl>();
            licenseRegistration = Substitute.For<LicenseRegistrationViewModel>();

            sut = new AboutViewModel(networkOperations, serviceControl, licenseRegistration);
        }
Exemple #16
0
        public IActionResult About()
        {
            var model = new AboutViewModel();

            model.Cloudinary = this.cloudinaryService.GetCloudinaryInstance();

            return(View(model));
        }
Exemple #17
0
        public void Given_new_viewmodel_TechnologySkills_should_not_be_null_and_should_count_some_items()
        {
            // arrange and act
            var vm = new AboutViewModel();

            // assert
            Assert.IsNotNull(vm.TechnologyList);
            Assert.IsTrue(vm.TechnologyList.Length > 0);
        }
Exemple #18
0
        public async Task <IActionResult> Index()
        {
            AboutViewModel viewModel = new AboutViewModel()
            {
                Abouts = await _context.Abouts.OrderBy(o => o.OrderBy).Include(a => a.AboutTranslates).ToListAsync()
            };

            return(View(viewModel));
        }
Exemple #19
0
        public void Show_AboutView()
        {
            var viewModel = new AboutViewModel();
            var view      = new AboutView {
                DataContext = viewModel
            };

            WindowFactory.CreateAndShow(view);
        }
        public void Copyright_Property_Returns_Value_From_AssemblyInfo()
        {
            var vm = new AboutViewModel();
            var copyrightAttrib = typeof(AboutViewModel).Assembly.GetAttribute <AssemblyCopyrightAttribute>();

            Assert.NotNull(vm.Copyright);
            Assert.NotEmpty(vm.Copyright);
            Assert.Equal(copyrightAttrib.Copyright, vm.Copyright);
        }
Exemple #21
0
        public void ShowAboutDialog()
        {
            UIServices.SetBusyState();

            var aboutView      = new AboutView();
            var aboutViewModel = new AboutViewModel();

            dialogService.ShowDialogWindow("About SigmaNEST ROI Calculator", null, null, aboutView, aboutViewModel, false);
        }
Exemple #22
0
        public About()
        {
            AboutViewModel viewModel = new AboutViewModel();

            DataContext             = viewModel;
            viewModel.RequestClose += () => this.Close();

            InitializeComponent();
        }
        public ActionResult About()
        {
            var viewModel = new AboutViewModel()
            {
                Heading = "Maslshop - About Us"
            };

            return(View(viewModel));
        }
Exemple #24
0
        public IActionResult About()
        {
            var about = new AboutViewModel();

            about.Formed = new DateTime(2019, 01, 01);
            about.Days   = (DateTime.Now - about.Formed).Days;

            return(View(about));
        }
Exemple #25
0
        public void BuildDateTextTest()
        {
            IXamarinWrapper xamarinWrapper = new XamarinWrapperStub();
            AboutViewModel  aboutViewModel = new AboutViewModel(xamarinWrapper);

            string s = aboutViewModel.BuildDateText;

            Assert.False(string.IsNullOrWhiteSpace(s));
        }
        public SettingsPage()
        {
            InitializeComponent();
            DataContext = UnigramContainer.Current.Resolve <SettingsViewModel, IUserDelegate>(this);

            NavigationCacheMode = NavigationCacheMode.Required;

            Diagnostics.Text = $"Unigram X {AboutViewModel.GetVersion()}";
        }
Exemple #27
0
        public ActionResult About()
        {
            AboutViewModel viewModel = new AboutViewModel();

            viewModel.BaseInfo = menu.ReturnMenu();
            viewModel.About    = db.Texts.Where(current => current.TextType.UrlParam == "about").FirstOrDefault();
            ViewBag.PageId     = "about-us";
            return(View(viewModel));
        }
Exemple #28
0
 public AboutWindow()
 {
     InitializeComponent();
     DataContext = new AboutViewModel();
     using (StreamReader reader = new StreamReader("../../../Resources/About.txt"))
     {
         docText.Inlines.Add(reader.ReadToEnd());
     }
 }
        public void NewInstance_HasExpectedGithubUrl()
        {
            // Arrange
            const string url = "github.com/test";
            var          vm  = new AboutViewModel(string.Empty, url);

            // Act & Assert
            Assert.Equal(url, vm.GitHubUrl);
        }
        public void NewInstance_HasExpectedHomeUrl()
        {
            // Arrange
            const string url = "test.com";
            var          vm  = new AboutViewModel(url, string.Empty);

            // Act & Assert
            Assert.Equal(url, vm.HomeUrl);
        }
Exemple #31
0
        public AboutPage()
        {
            InitializeComponent();

            ViewModel = BindingContext as AboutViewModel;

            GoButton.SetBinding(Button.CommandProperty, nameof(ViewModel.GoOneLevelDeeperCommand));
            GoWithCodeBehind.SetBinding(Button.CommandProperty, nameof(ViewModel.GoOneLevelDeeperWithPageCommand));
        }
Exemple #32
0
        private void InitAboutViewModel(ButtonDisplayOptions buttonDisplayOptions = null)
        {
            if (buttonDisplayOptions == null)
            {
                buttonDisplayOptions = new ButtonDisplayOptions(false, false);
            }

            _aboutViewModel = new AboutViewModel(_versionHelper, buttonDisplayOptions, _translationUpdater, _commandLocator, new DesignTimeApplicationNameProvider());
        }
Exemple #33
0
        public Design()
        {
            About = new AboutViewModel( new DesignBrowserService(), new DesignEmailService(), new DesignAppRatingService() );
            Main = new MainViewModel( new DesignNavigationService(), new DesignPluginLoader(), new DesignMainSettings(), new DesignTileService() );
            Settings = new SettingsViewModel( new DesignMainSettings(), new DesignCredentialsStorage(), new DesignTileService() );

            About.OnNavigatedTo();
            Main.OnNavigatedTo();
            Settings.OnNavigatedTo();
        }
Exemple #34
0
        private void UpdateAboutContent(AboutViewModel viewModel)
        {
            var aboutContent = _aboutContent.GetAll().Single();

            aboutContent.Name = viewModel.Name;
            aboutContent.CompanyName = viewModel.CompanyName;
            aboutContent.Origins = viewModel.Origins;
            aboutContent.Materials = viewModel.Materials;

            _aboutContent.Update(aboutContent);
        }
        public ActionResult Index(string account)
        {
            #region Comment

            //if (string.IsNullOrEmpty(account))
            //{
            //    account = Session["register-info"].ToString();
            //}
            //const string emailRegex = @"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$";
            //const string phoneRegex = @"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$";
            //var mailRe = new Regex(emailRegex);
            //var phoneRe = new Regex(phoneRegex);
            //if (mailRe.IsMatch(account))
            //{
            //    model.User = repo.Gets().FirstOrDefault(m => m.Email.Equals(account));
            //}
            //else if (phoneRe.IsMatch(account))
            //{
            //    model.User = repo.Gets().FirstOrDefault(m => m.PhoneNumber.Equals(account));
            //}
            //else
            //{
            //    model.User = repo.Gets().FirstOrDefault(m => m.UserName.Equals(account));
            //}

            #endregion

            var model = new AboutViewModel();
            var repo = new Repository<UserModel>(DbCollection.User);
            var repoShare = new Repository<ShareSettingModel>(DbCollection.ShareSetting);
            var repoEducation = new Repository<EducationModel>(DbCollection.Education);
            var repoExperience = new Repository<ExperienceModel>(DbCollection.Experience);
            var repoExperienceEmployment = new Repository<ExperienceEmploymentModel>(DbCollection.ExperienceEmployment);
            var repoContact = new Repository<ContactModel>(DbCollection.Contact);
            var userId = !string.IsNullOrEmpty(account) ? account.Split('-').Last() : User.Identity.GetUserId();
            var user = repo.GetById(userId);
            model.User = user;
            var shareSetting = repoShare.Gets().First(m => m.UserId.Equals(userId));
            var share = new ShareViewModel
            {
                ShareSetting = shareSetting
            };
            model.Share = share;
            model.ListEducation = repoEducation.Gets().Where(m => m.UserId.Equals(userId)).ToList();
            model.Experience = repoExperience.Gets().FirstOrDefault(m => m.UserId.Equals(userId));
            model.ListExperienceEmployment = repoExperienceEmployment.Gets().Where(m => m.UserId.Equals(userId)).ToList();
            model.ListContact = repoContact.Gets().Where(m => m.UserId.Equals(userId)).ToList();
            // Read or Edit
            model.Modify = userId == User.Identity.GetUserId();
            model.FlIdUser = user.FirstName.UrlFriendly() + '-' + user.LastName.UrlFriendly() + "-" + user.Id;
            // Test Log
            Log.Error(new Exception("Test"));
            return View(model);
        }
Exemple #36
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AboutWindow"/> class.
        /// </summary>
        /// <param name="viewModel">The view model to inject.</param>
        /// <remarks>
        /// This constructor can be used to use view-model injection.
        /// </remarks>
        public AboutWindow(AboutViewModel viewModel)
            : base(viewModel, DataWindowMode.Custom)
        {
            var dependencyResolver = this.GetDependencyResolver();
            var languageService = dependencyResolver.Resolve<ILanguageService>();

            //AddCustomButton(new DataWindowButton(languageService.GetString("EnableLogging"), "EnableLogging"));

            InitializeComponent();

            this.ApplyApplicationIcon();
        }
Exemple #37
0
        private AboutViewModel LoadAboutViewModel()
        {
            var content = _aboutContent.GetAll().Single();
            var vm = new AboutViewModel
            {
                Name = content.Name,
                CompanyName = content.CompanyName,
                Origins = content.Origins,
                Materials = content.Materials
            };

            return vm;
        }
Exemple #38
0
        public Design()
        {
            About = new AboutViewModel( new DesignBrowserService(), new DesignEmailService(), new DesignRatingService() );
            Main = new MainViewModel( new DesignNavigationService(), new DesignServerAccess(), new DesignPluginLoader(),
                                      new DesignMainSettings(), new DesignTileService(),
                                      new ViewPluginRequest() );
            Settings = new SettingsViewModel( new DesignMainSettings(), new DesignAuthenticator(), new DesignNavigationService(),
                                              new DesignAuthenticationService(), new DesignCredentialsStorage(), new DesignTileService() );

            About.OnNavigatedTo();
            Main.OnNavigatedToAsync();
            Settings.OnNavigatedTo();
        }
        public AboutWindow()
        {
            InitializeComponent();

            var asm = Assembly.GetExecutingAssembly();
            var vm = new AboutViewModel();
            vm.Copyright = asm.GetCustomAttribute<AssemblyCopyrightAttribute>().Copyright;
            vm.Title = asm.GetCustomAttribute<AssemblyProductAttribute>().Product;
            vm.Version = asm.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
            vm.Url = "https://sourceforge.net/projects/reliak-timer";
            vm.UrlSource = "https://github.com/reliak/reliak-timer";

            this.DataContext = vm;
        }
        public ActionResult About()
        {
            HeaderViewModel header = new HeaderViewModel()
            {
                Heading = AboutHeading,
                BackgroundUrl = AboutBackgroundUrl,
                SubHeading = AboutSubHeading
            };

            AboutViewModel aboutModel = new AboutViewModel()
            {
                Header = header
            };

            return this.View("About", aboutModel);
        }
        public ApplicationController(Lazy<ShellViewModel> shellViewModelLazy,
            Lazy<SettingsViewModel> settingsViewModelLazy,
            Lazy<AboutViewModel> aboutViewModelLazy, Lazy<HelpViewModel> helpViewModelLazy,
            Lazy<LogViewModel> logViewModelLazy,
            Lazy<ShellService> shellServiceLazy, CompositionContainer compositionContainer,
            Lazy<IAccountAuthenticationService> accountAuthenticationServiceLazy, IShellController shellController,
            Lazy<SystemTrayNotifierViewModel> lazySystemTrayNotifierViewModel,
            IGuiInteractionService guiInteractionService, ILogController logController)
        {
            //ViewModels
            _shellViewModel = shellViewModelLazy.Value;
            _settingsViewModel = settingsViewModelLazy.Value;
            _aboutViewModel = aboutViewModelLazy.Value;
            _helpViewModel = helpViewModelLazy.Value;
            _logViewModel = logViewModelLazy.Value;
            _systemTrayNotifierViewModel = lazySystemTrayNotifierViewModel.Value;
            //Commands
            _shellViewModel.Closing += ShellViewModelClosing;
            _exitCommand = new DelegateCommand(Close);

            //Services
            AccountAuthenticationService = accountAuthenticationServiceLazy.Value;

            _shellService = shellServiceLazy.Value;
            _shellService.ShellView = _shellViewModel.View;
            _shellService.SettingsView = _settingsViewModel.View;
            _shellService.AboutView = _aboutViewModel.View;
            _shellService.HelpView = _helpViewModel.View;
            _shellService.LogView = _logViewModel.View;
            _shellController = shellController;
            _guiInteractionService = guiInteractionService;
            _logController = logController;
            if (_shellViewModel.IsSettingsVisible)
            {
                _settingsViewModel.Load();
            }
        }
Exemple #42
0
        public ActionResult Edit(AboutViewModel viewModel)
        {
            UpdateAboutContent(viewModel);

            return View("Index", LoadAboutViewModel());
        }
        public ActionResult SettingDetails()
        {
            var model = new AboutViewModel
            {
                User = GetOwnerUser()
            };

            #region Share
            var share = new ShareViewModel();
            var repoShare = new Repository<ShareSettingModel>(DbCollection.ShareSetting);
            var repoSystemShare = new Repository<SystemShareModel>(DbCollection.SystemShare);
            share.ShareSetting = repoShare.Gets().First(m => m.UserId.Equals(User.Identity.GetUserId()));
            share.ListSystemShare = repoSystemShare.Gets().Where(m => m.Enable.Equals(true)).ToList();
            model.Share = share;
            #endregion

            return PartialView("_DetailsPartial", model);
        }
 public AboutView()
 {
     InitializeComponent();
     DataContext = new AboutViewModel();
 }
        public void AboutShouldReturnCorrectViewModel()
        {
            HeaderViewModel header = new HeaderViewModel()
            {
                Heading = AboutHeading,
                BackgroundUrl = AboutBackgroundUrl,
                SubHeading = AboutSubHeading
            };

            AboutViewModel aboutModel = new AboutViewModel()
            {
                Header = header
            };

            var controller = new StaticPagesController();
            var result = controller.About() as ViewResult;
            Assert.AreEqual(aboutModel.Header.Heading, (result.Model as AboutViewModel).Header.Heading);
            Assert.AreEqual(aboutModel.Header.SubHeading, (result.Model as AboutViewModel).Header.SubHeading);
            Assert.AreEqual(aboutModel.Header.BackgroundUrl, (result.Model as AboutViewModel).Header.BackgroundUrl);
        }
        private void DisplayAboutDialog(object sender, EventArgs e)
        {
            var aboutDialog = new AboutViewModel();

            WindowManager.Instance.ShowDialog(aboutDialog);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MahAppsAboutView"/> class.
 /// </summary>
 /// <param name="viewModel">The view model to inject.</param>
 /// <remarks>
 /// This constructor can be used to use view-model injection.
 /// </remarks>
 public MahAppsAboutView(AboutViewModel viewModel)
     : base(viewModel, DataWindowMode.Close)
 {
     InitializeComponent();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AboutWindow"/> class.
 /// </summary>
 /// <param name="viewModel">
 /// The view model to inject.
 /// </param>
 /// <remarks>
 /// This constructor can be used to use view-model injection.
 /// </remarks>
 public AboutWindow(AboutViewModel viewModel)
     : base(viewModel)
 {
     InitializeComponent();
 }