public App() { LocService = DependencyService.Get<HelperClasses.ILocationProvider>(); page1 = new OurCrousalPage("CarousalPage1.jpg"); page2 = new OurCrousalPage("CarousalPage2.jpg"); page1.btnEntry.IsEnabled = false; page2.btnEntry.IsEnabled = false; counter = 0; carousal = new CarouselPage(); carousal.Children.Add(page1); carousal.Children.Add(page2); fileService = DependencyService.Get<ISaveAndLoad>(); page1.btnEntry.Clicked += delegate { MainPage = new NavigationPage(new HomePage()) { BarBackgroundColor = ZadSpecialDesigen.ZadGreenNavBar, BarTextColor = Color.White, Icon = "icon2.png", }; page1 = null; page2 = null; carousal = null; }; page2.btnEntry.Clicked += delegate { navigationPage = new NavigationPage(new HomePage()) { BarBackgroundColor = ZadSpecialDesigen.ZadGreenNavBar, BarTextColor = Color.White, Icon = "icon2.png", }; MainPage = navigationPage; page1 = null; page2 = null; carousal = null; }; MainPage = carousal; if (Device.OS == TargetPlatform.iOS) { var time = TimeSpan.FromSeconds(3); Device.StartTimer(time, Swapping); } }
public ACResultViewModel(IPdfCreatorService pdfCreator, ISaveAndLoad saveAndLoad, INavigationService navigationService, IUnityContainer container, IDataService dataService, ICalculationOutput calculationOutput, ICalculationInput calculationInput, ICalculatorService calculatorService, IPageDialogService dialogService, IEventAggregator eventAggregator) { _pdfCreator = pdfCreator; _saveAndLoad = saveAndLoad; _navigationService = navigationService; _dataService = dataService; _calculationInput = calculationInput as CalculationInput; _calculationOutput = calculationOutput as CalculationOutput; _container = container; _calculatorService = calculatorService; _dialogService = dialogService; _eventAggregator = eventAggregator; //_eventAggregator.GetEvent<CalculationOutputUpdated>().Subscribe(HandleCalculationOutputUpdated); //_eventAggregator.GetEvent<CalculationInputUpdated>().Subscribe(HandleCalculationInputUpdated); }
public byte[] GetBytes(object obj) { byte[] bytes; ISaveAndLoad save = obj as ISaveAndLoad; if (save != default) { save.Save(); } bytes = IGetBytes(obj); if (Key != null) { bytes = byteArrayBinario.GetBytes(Key.Encrypt(bytes)); } return(bytes); }
public HtmlJsTestViewModel() { LoadFormCommand = new Command(async() => await LoadForm()); LoadFormWithResourcesCommand = new Command(async() => await LoadFormWithResources()); LoadMintFormCommand = new Command(async() => await LoadMintForm()); htmlWebViewSource = new HtmlWebViewSource(); UrlWebViewSource = new UrlWebViewSource(); FileManager = DependencyService.Get <ISaveAndLoad>(); if (Device.RuntimePlatform == Device.iOS) { UrlWebViewSource.Url = ""; } //UrlAssest = "https://doc-08-8o-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/806i5vtdk08ktk4ns9phuufun1mkr0j0/1521756000000/03041252391972702159/*/1S_uc70fZt5z5jbLz5Kc81Tww58AWVQCq?e=download"; }
public MainWindowViewModel(ISaveAndLoad saveAndLoad, IPdfCreatorService pdfCreatorService, IEventAggregator eventAggregator, IRegionManager regionManager, IUnityContainer container) { //pdf generation _saveAndLoad = saveAndLoad; _pdfCreatorService = pdfCreatorService; //setup modal regions _regionManager = regionManager; _regionManager.RegisterViewWithRegion("ArcDurationCalculationRegion", typeof(ArcDurationCalculationView)); _regionManager.RegisterViewWithRegion("FindSafeWorkingDistanceRegion", typeof(FindSafeWorkingDistanceView)); _regionManager.RegisterViewWithRegion("FindEquipmentTripCurvesRegion", typeof(FindEquipmentTripCurvesView)); _regionManager.RegisterViewWithRegion("StandardWorkingDistanceRegion", typeof(StandardWorkingDistancesView)); _regionManager.RegisterViewWithRegion("SettingsRegion", typeof(SettingsView)); //setup main regions _regionManager.RegisterViewWithRegion("ContentRegion", typeof(FormView)); _regionManager.RegisterViewWithRegion("ContentRegion", typeof(ConfirmationView)); _regionManager.RegisterViewWithRegion("ContentRegion", typeof(ResultsView)); //container _container = container; //setup events _eventAggregator = eventAggregator; _eventAggregator.GetEvent <CalculationInputUpdated>().Subscribe(UpdateCalculationInput); _eventAggregator.GetEvent <ArcDurationUpdated>().Subscribe(UpdateArcDuration); _eventAggregator.GetEvent <CalculationOutputUpdated>().Subscribe(HandleCalculationOutputUpdated); _eventAggregator.GetEvent <OpenModalEvent>().Subscribe(HandleOpenModalEvent); _eventAggregator.GetEvent <CloseModalEvent>().Subscribe(HandleCloseModalEvent); _eventAggregator.GetEvent <UseForNewCalculationClicked>().Subscribe(HandleUseForNewCalculationClicked); //setup commands GoBackCommand = new DelegateCommand(GoBack); StartOverCommand = new RelayCommand(ClickStartOver, CanClickStartOver); NextCommand = new RelayCommand(ClickNext, CanClickNext); SettingsCommand = new RelayCommand(ShowSettings); CalculationHistoryCommand = new RelayCommand(ShowCalculationHistory); ExportCommand = new RelayCommand(DoExport); //defaults HasErrors = true; }
public Restaurant_Card_Page3ViewModel(INavigationService navigationService, ISaveAndLoad saveAndLoadService, ICensusService censusService, ICacheManager cacheManager, IDialogService dialogService) : base(navigationService, dialogService) { _navigationService = navigationService; _dialogService = dialogService; _saveAndLoadService = saveAndLoadService; _censusService = censusService; _cacheManager = cacheManager; //普查步骤 var steps = new Dictionary <int, string> { { 0, "基础信息" }, { 1, "经营信息" }, { 2, "销售信息" } }; Steps = steps; Step = 3; Title = "添加餐饮终端普查-销售信息"; }
// いったんコメントアウト これが実行されない // ^> IDependencyService dependencyServiceすればいけるけど解せない // https://prismlibrary.com/docs/xamarin-forms/Dependency-Service.html public MainPageViewModel(IPageDialogService pageDialogService, INavigationService navigationService, IDependencyService dependencyService) : base(navigationService) { System.Diagnostics.Debug.WriteLine("(´・ω・`)ViewModel start"); ISaveAndLoad sal = dependencyService.Get <ISaveAndLoad>(); INotificationOnAndOff ins = dependencyService.Get <INotificationOnAndOff>(); ICreateService ics = dependencyService.Get <ICreateService>(); Model = new MainPageModel(sal, ins, ics); this.Model.PropertyChanged += Model_PropertyChanged; _pageDialogService = pageDialogService; Title = "通知メモ"; // _pageDialogService.DisplayAlertAsync("確認", "利用するには他のアプリの上に重ねて表示する権限を許可してください。", "はい"); //if (!ics.CheckPermission()) //{ // _pageDialogService.DisplayAlertAsync("確認", "利用するには他のアプリの上に重ねて表示する権限を許可してください。", "はい"); //} }
public Tradition_Card_Page3ViewModel(INavigationService navigationService, ISaveAndLoad saveAndLoadService, ICensusService censusService, ICacheManager cacheManager, IDialogService dialogService) : base(navigationService, dialogService) { _navigationService = navigationService; _dialogService = dialogService; _saveAndLoadService = saveAndLoadService; _censusService = censusService; _cacheManager = cacheManager; //普查步骤 var steps = new Dictionary <int, string> { { 0, "基础信息" }, { 1, "经营信息" }, { 2, "销售信息" } }; Steps = steps; Step = 3; Title = "添加传统终端普查-销售信息"; Products = new ObservableCollection <SalesProduct>(); }
public CoreModel(IFetchSensorData fetchSensorData, IBackgroundTask backgroundTask, ISaveAndLoad saveAndLoad) { this.FetchSensorData = fetchSensorData; this.BackgroundTask = backgroundTask; this.SaveAndLoad = saveAndLoad; }
public SaveLoadString() { _fileService = DependencyService.Get <ISaveAndLoad>(); //LoadTextAndView(); }
/// <summary> /// コンストラクタです。VMからInterfaceを受け取りModelで使用可能にします。 /// </summary> /// <param name="sal">ISaveAndLoad インターフェイス型</param> /// <param name="ins">INotificationOnAndOff インターフェイス型</param> /// <param name="ics">ICreateService インターフェイス型</param> public MainPageModel(ISaveAndLoad sal, INotificationOnAndOff ins, ICreateService ics) { SaveAndLoad = sal; NotificationService = ins; CreateService = ics; }
static void Main(string[] args) { string demoText = "Hallo"; Person p1; //null p1 = new Person(); //new forder speichert für das Objekt vom Typ Person p1.Alter = 7; //nullreference exception p1.Vorname = "Maria"; Person p2 = new Person(30); //p2.Alter = 30; p2.Vorname = "Kurt"; SayHello(p1); SayHello(p2); Person p3 = new Person() { Alter = 47, Vorname = "Sabine" }; //Value-Variablen int zahl = 20; ChangeValue(zahl); //zahl? -- 20 / 17 //Reference variable ChangeReference(p3); MusikerIn m = new MusikerIn(); m.Vorname = "Willi"; m.Instrument = "Gitarre"; m.Spielen(); Person p = m; //Up-Cast -- implizit //p.Instrument - Property ist nur über MusikerIn verfügbar if (p is MusikerIn) { MusikerIn m2 = (MusikerIn)p;//Downcast würde zu InvalidCastException falls keine MusikerIn } MitarbeiterIn mitarbeiterIn1 = new MitarbeiterIn(); mitarbeiterIn1.Gehalt = 200; Person person = mitarbeiterIn1; Person[] meinePersonen = new Person[2]; meinePersonen[0] = m; meinePersonen[1] = person; p2.SayHello(); mitarbeiterIn1.SayHello(); Person pUrsprungMitarbeteiterIn = mitarbeiterIn1; //Latebinding bei polymorphen Methoden-Aufrufen pUrsprungMitarbeteiterIn.SayHello(); //Person oder MitarbeiterIn? //m2.SayHello(); //Early-Binding - Methode ist nicht als polymorph gekennzeichnet pUrsprungMitarbeteiterIn.SayGoodbye(); meinePersonen[0].PrintInfo(); ISaveAndLoad[] speichernUndLaden = new ISaveAndLoad[2]; speichernUndLaden[0] = p1; speichernUndLaden[1] = m; if (speichernUndLaden[1] is MusikerIn) { MusikerIn mDownCast = (MusikerIn)speichernUndLaden[1]; } }
public StorageService() { StorageClient = DependencyService.Get<ISaveAndLoad>(); }