Example #1
0
 private SelectStateViewModel(IDataService service, Country country, State state, Action<State> select,
                              Action cancel)
 {
     _service = service;
     _initialCountry = country;
     _initialState = state;
     _select = select;
     _cancel = cancel;
 }
 private SelectSuburbViewModel(IDataService service, Country country, State state, Suburb suburb,
                               Action<Suburb> select, Action cancel)
 {
     _service = service;
     _initialCountry = country;
     _initialState = state;
     _initialSuburb = suburb;
     _select = select;
     _cancel = cancel;
 }
Example #3
0
     private void FixupCountry(Country previousValue, bool skipKeys = false)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (Country != null)
         {
             CountryId = Country.Id;
         }
 
         else if (!skipKeys)
         {
             CountryId = null;
         }
 
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("Country")
                 && (ChangeTracker.OriginalValues["Country"] == Country))
             {
                 ChangeTracker.OriginalValues.Remove("Country");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("Country", previousValue);
             }
             if (Country != null && !Country.ChangeTracker.ChangeTrackingEnabled)
             {
                 Country.StartTracking();
             }
         }
     }
 // Shared static public methods
 public static void Ask(IDataService service, Country country, State state, Suburb suburb,
                        Action<Suburb> select, Action cancel)
 {
     (new SelectSuburbViewModel(service, country, state, suburb, select, cancel)).Ask();
 }
Example #5
0
 static SettingViewModel()
 {
     ApplySettingDefault();
     DummyCity = new City() { Id = -1, Name = "-select-" };
     DummyAssociation = new Association() { Id = -1, Name = "-ALL ASSOCIATIONS-" };
     DummyCountry = new Country() { Id = -1, Name = "-ALL COUNTRIES-", HasStates = true, DisplayStates = true };
     DummyState = new State() { Id = -1, Name = "-select-" };
 }
Example #6
0
     public bool Equals(Country other)
     {
         if (ReferenceEquals(null, other)) return false;
         if (ReferenceEquals(this, other)) return true;
 		if (other.Id == 0 && Id == 0)
 			return false;
 		else
 			return other.Id == Id;
     }