public void LoadTerritoryList() { if (!IsTerritoryListLoading) { IsTerritoryListLoading = true; TerritoryListEntries = new ObservableCollection <TerritoryCardModel>(); } TerritoryCardData[] d = TerritoryCardsInterface.GetTerritoryCards(SortOrder.AscendingGeneric); if (d == null) { IsTerritoryListLoading = false; return; } foreach (var c in d) { TerritoryListEntries.Add(new TerritoryCardModel(c.ItemId) { Image = c.Image, DateCreated = c.DateCreated, Notes = c.Notes, StreetCount = 0, TerritoryNumber = c.TerritoryNumber }); } IsTerritoryListLoading = false; }
internal bool SaveOrUpdate() { var r = TerritoryCardsInterface.AddOrUpdateTerritoryCard(ref TerritoryCard); if (r) { OnPropertyChanged("TerritoryCardImage"); OnPropertyChanged("TerritoryCardNotes"); OnPropertyChanged("TerritoryCardTerritoryNumber"); } return(r); }
/// <summary> /// Constructor for the Application object. /// </summary> public App() { // Ensure the current culture passed into bindings // is the OS culture. By default, WPF uses en-US // as the culture, regardless of the system settings. LocalizationManager.GlobalStringLoader = new TelerikStringLoader(); Thread.CurrentThread.CurrentCulture = CultureInfo.CurrentUICulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture; var radDiagnostics = new RadDiagnostics(); radDiagnostics.EmailTo = "*****@*****.**"; radDiagnostics.IncludeScreenshot = true; radDiagnostics.Init(); (App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color = Color.FromArgb(0xFF, 0xD2, 0xDA, 0x86); _settingsProvider = new SettingsProvider(); // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Standard Silverlight initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); // Show graphics profiling information while debugging. if (Debugger.IsAttached) { // Display the current frame rate counters. Current.Host.Settings.EnableFrameRateCounter = false; // Show the areas of the app that are being redrawn in each frame. //Application.Current.Host.Settings.EnableRedrawRegions = true; // Enable non-production analysis visualization mode, // which shows areas of a page that are handed off to GPU with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; // Disable the application idle detection by setting the UserIdleDetectionMode property of the // application's PhoneApplicationService object to Disabled. // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run // and consume battery power when the user is not using the phone. PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; } TimeDataInterface.CheckDatabase(); ReturnVisitsInterface.CheckDatabase(); RvPreviousVisitsDataInterface.CheckDatabase(); RBCTimeDataInterface.CheckDatabase(); TerritoryCardsInterface.CheckDatabase(); StreetBuildingInterface.CheckDatabase(); House2HouseRecordsInterface.CheckDatabase(); }