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;
 }
Exemple #2
0
     private void FixupSuburb(Suburb previousValue, bool skipKeys = false)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (Suburb != null)
         {
             SuburbId = Suburb.Id;
         }
 
         else if (!skipKeys)
         {
             SuburbId = null;
         }
 
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("Suburb")
                 && (ChangeTracker.OriginalValues["Suburb"] == Suburb))
             {
                 ChangeTracker.OriginalValues.Remove("Suburb");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("Suburb", previousValue);
             }
             if (Suburb != null && !Suburb.ChangeTracker.ChangeTrackingEnabled)
             {
                 Suburb.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();
 }
Exemple #4
0
     public bool Equals(Suburb 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;
     }