/// <summary> /// Construct which takes the underlying list and its associated context. /// </summary> /// <param name="list"></param> /// <param name="context"></param> public ModelList(DefaultScope.List list, ListSampleOfflineContext context) { this.list = list; this.context = context; items = null; // Register for the property changed event list.PropertyChanged += new PropertyChangedEventHandler(list_PropertyChanged); }
/// <summary> /// Creates and initializes the context /// </summary> /// <param name="cachePath"></param> /// <param name="uri"></param> private void CreateContext(string cachePath, Uri uri) { context = new ListSampleOfflineContext(cachePath, uri); // Need to specify the filter paramters. context.CacheController.ControllerBehavior.AddScopeParameters("userid", UserID.ToString("D")); context.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(ContextLoadCompleted); context.CacheController.RefreshCompleted += new EventHandler<RefreshCompletedEventArgs>(CacheController_RefreshCompleted); }