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