public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); //d Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => { if (null != e.View.AutomationId) { e.NativeView.AccessibilityIdentifier = e.View.AutomationId; } }; reportDatabase = new ReportDatabase(); #if ENABLE_TEST_CLOUD Xamarin.Calabash.Start(); #endif LoginUIExtension.Init(); CrossMedia.Current.Initialize(); formsApp = new App(); LoadApplication(formsApp); return(base.FinishedLaunching(app, options)); }
public void LoadReports() { if (File.Exists(localReportXML)) { XmlSerializer serializer = new XmlSerializer(typeof(ReportDatabase)); FileStream stream = new FileStream(localReportXML, FileMode.Open, FileAccess.ReadWrite); using (StreamReader _stream = new StreamReader(stream, Encoding.GetEncoding("UTF-8"))) { reportDB = serializer.Deserialize(stream) as ReportDatabase; } stream.Close(); } else if (File.Exists(globalReportXML)) { XmlSerializer serializer = new XmlSerializer(typeof(ReportDatabase)); FileStream stream = new FileStream(globalReportXML, FileMode.Open, FileAccess.ReadWrite); using (StreamReader _stream = new StreamReader(stream, Encoding.GetEncoding("UTF-8"))) { reportDB = serializer.Deserialize(stream) as ReportDatabase; } stream.Close(); SaveReports(false); } else { SaveReports(); } }
public ReportDetailViewModel(ExpenseReport report) { nameEditImageSource = "ic_mode_edit_white_48pt.png"; reportDatabase = new ReportDatabase(); expenseDatabase = new MyExpensesDatabase(); Report = report; Report.Expenses = new List <ExpenseModel> (); }
public void OnActivityCreated(Activity activity, Bundle savedInstanceState) { CrossCurrentActivity.Current.Activity = activity; global::Xamarin.Forms.Forms.Init(activity, savedInstanceState); BlobCache.ApplicationName = "MyExpenses"; BlobCache.EnsureInitialized(); reportDatabase = new ReportDatabase(); }
public NewReportPageViewModel() { reportDatabase = new ReportDatabase(); expenseDatabase = new MyExpensesDatabase(); Report = new ExpenseReport { CreatedOn = String.Format("{0:M/d/yyyy}", DateTime.Now), Total = "0.00", Status = Status.PendingSubmission, }; Report.Expenses = new List <ExpenseModel> (); CreateReportID(); }
public ReportsPageViewModel() { database = new ReportDatabase(); }