Exemple #1
0
        /// <summary>
        /// Adds a new HubRelationship to the Model.
        /// </summary>
        /// <param name="hub">The Hub object associated with the new HubRelationship.</param>
        /// <param name="dataSource">The DataSource to which the HubRelationship will be added.</param>
        private void AddHubRelationshipToModel(Hub hub, DataSource dataSource)
        {
            HubRelationship hubRelationship = Model.AddHubRelationship(hub, dataSource);

            // Add View Model.
            if (HubRelationshipsVM.HubRelationships == null)
            {
                throw new InvalidOperationException("HubRelationships was null!");
            }

            // MainViewModel knows about HubRelationShipVM AND has access to the new hubRelationship.
            // That's why it makes sense to do this here.
            HubRelationshipsVM.HubRelationships.Add(new HubRelationshipViewModel(hubRelationship));
        }
Exemple #2
0
 public RemoveHubRelationship(HubRelationship hubRelationship, DataSource dataSource)
 {
     HubRelationship = hubRelationship;
     DataSource      = dataSource;
 }
Exemple #3
0
 /// <summary>
 /// Adds a new HubRelationship to the Model.
 /// </summary>
 /// <param name="hub">The Hub object associated with the new HubRelationship.</param>
 /// <param name="dataSource">The DataSource to which the HubRelationship will be added.</param>
 private static void RemoveHubRelationshipFromModel(HubRelationship hub, DataSource dataSource)
 {
     Model.RemoveHubRelationship(hub, dataSource);
 }
 public HubRelationshipViewModel(HubRelationship hubRelationship)
 {
     HubRelationship = hubRelationship;
 }