public override void Apply(IOperationCollection operations) { ILocator locator = operations.Locator; IDataContainer data; if (Container.TryGetValue(locator, out data)) { FillPercentage -= data.FillPercentage; if (locator.Apply.Leaf(operations, data)) { IsModified = true; } FillPercentage += data.FillPercentage; //if (data.IsEmpty) // Container.Remove(locator); } else { data = locator.CreateDataContainer(); Debug.Assert(data != null); if (locator.Apply.Leaf(operations, data)) { IsModified = true; } FillPercentage += data.FillPercentage; if (!data.IsEmpty) { Container.Add(locator, data); } } }