public void Load() { Status = VMLocator.GetViewModel <StatusVM>(); Status.StatusString = "Please add a location to look for movies."; AddLocationCommand = new RelayCommand(AddLocationCmd); RemoveLocationCommand = new RelayCommand <long>(RemoveLocationCmd, i => true); Locations = new ObservableCollection <MediaLocation>(); Locations.CollectionChanged += Locations_CollectionChanged; if (!_collectionManager.IsAnyLocationAdded()) { AddLocation(new MediaLocation { Path = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos), IsToMonitor = true }); } else { foreach (var mediaLocation in _collectionManager.GetAllMovieLocations()) { AddLocation(mediaLocation); } } }
//https://bugzilla.xamarin.com/show_bug.cgi?id=27299 public void BindingOnBindingContextDoesntReapplyBindingContextBinding() { var bindable = new MockBindable(); var locator = new VMLocator(); Assert.AreEqual(0, locator.Count); locator.Invoked += (sender, e) => Assert.IsTrue(locator.Count <= 1); bindable.SetBinding(BindableObject.BindingContextProperty, new Binding("VM", source: locator)); Assert.IsTrue(locator.Count == 1); }
public NavigationService(VMLocator loc) { _vmLocator = loc; //TEST testView = new Lazy <VTestPage>(() => new VTestPage()); //REAL loginView = new Lazy <VLogin>(() => new VLogin()); signupView = new Lazy <VSignup>(() => new VSignup()); userpagesView = new Lazy <VUserPages>(() => new VUserPages()); timelinelistView = new Lazy <VTimelineList>(() => new VTimelineList()); optionsView = new Lazy <VOptions>(() => new VOptions()); timelineView = new Lazy <VTimeline>(() => new VTimeline()); }
public void Load() { Status = VMLocator.GetViewModel <StatusVM>(); Status.StatusString = "Please add a location to look for movies."; AddLocationCommand = new RelayCommand(AddLocationCmd); RemoveLocationCommand = new RelayCommand <long>(RemoveLocationCmd, i => true); Locations = new ObservableCollection <MediaLocation>(); Locations.CollectionChanged += Locations_CollectionChanged; if (_collectionManager.IsAnyLocationAdded()) { foreach (var mediaLocation in _collectionManager.GetAllMovieLocations()) { AddLocation(mediaLocation); } } }
public App() { InitializeComponent(); var loggingConfig = AWSConfigs.LoggingConfig; loggingConfig.LogMetrics = true; loggingConfig.LogResponses = ResponseLoggingOption.Always; loggingConfig.LogMetricsFormat = LogMetricsFormatOption.JSON; loggingConfig.LogTo = LoggingOptions.SystemDiagnostics; AWSConfigs.AWSRegion = RegionEndpoint.EUCentral1.SystemName; AWSConfigs.CorrectForClockSkew = true; AWSConfigs.UseSdkCache = false; VMLocator locator = (VMLocator)Current.Resources["vmLocator"]; if (!DesignMode.IsDesignModeEnabled) { Task.Run(async() => await locator.Services.Authentication.GetCachedCredentials()).Wait(); if (locator.Services.Authentication.CurrentUser.LoggedIn) { MainPage = new NavigationPage(locator.Services.Navigation.UserPagesView()); locator.UserPagesViewModel.User = locator.Services.Authentication.CurrentUser; } else { MainPage = new NavigationPage(locator.Services.Navigation.LoginPage()); } } else { MainPage = new NavigationPage(locator.Services.Navigation.LoginPage()); } }
public ShiftsManager(VMLocator vmLocator, XamlRoot xamlRoot) { _vmLocator = vmLocator; _messenger = vmLocator.GetMessenger(); _xamlRoot = xamlRoot; }