Exemple #1
0
 void lazyLoadHandlers(LoadContentContext context, BingLocationPart part)
 {
     // add handlers that will load content just-in-time
     part.BingMapListField.Loader(() =>
                                  part.Record.BingMapList == null ?
                                  null : _contentManager.Get(part.Record.BingMapList.Id));
 }
Exemple #2
0
 public void UpdateBingMapList(BingLocationPart part, EditBingLocationViewModel model)
 {
     if (model.BingMapListId != null)
     {
         part.BingMapList = _contentManager.Get((int)model.BingMapListId);
     }
     else
     {
         part.BingMapList = null;
     }
 }
Exemple #3
0
        static void propertySetHandlers(InitializingContentContext context, BingLocationPart part)
        {
            // add handlers that will update records when part properties are set
            part.BingMapListField.Setter(sponsor =>
            {
                part.Record.BingMapList = sponsor == null
                                        ? null
                                        : sponsor.ContentItem.Record;
                return(sponsor);
            });

            // Force call to setter if we had already set a value
            if (part.BingMapListField.Value != null)
            {
                part.BingMapListField.Value = part.BingMapListField.Value;
            }
        }