Add xmldoc and tidy up logic in `Skin`

This commit is contained in:
Dean Herbert 2021-05-13 13:09:33 +09:00
parent 992a052426
commit c93ed541f3
1 changed files with 9 additions and 4 deletions

View File

@ -61,11 +61,19 @@ protected Skin(SkinInfo skin, IStorageResourceProvider resources)
}
}
/// <summary>
/// Remove all stored customisations for the provided target.
/// </summary>
/// <param name="targetContainer">The target container to reset.</param>
public void ResetDrawableTarget(SkinnableElementTargetContainer targetContainer)
{
DrawableComponentInfo.Remove(targetContainer.Target);
}
/// <summary>
/// Update serialised information for the provided target.
/// </summary>
/// <param name="targetContainer">The target container to serialise to this skin.</param>
public void UpdateDrawableTarget(SkinnableElementTargetContainer targetContainer)
{
DrawableComponentInfo[targetContainer.Target] = targetContainer.CreateSerialisedChildren().ToArray();
@ -76,10 +84,7 @@ public virtual Drawable GetDrawableComponent(ISkinComponent component)
switch (component)
{
case SkinnableTargetComponent target:
var skinnableTarget = target.Target;
if (!DrawableComponentInfo.TryGetValue(skinnableTarget, out var skinnableInfo))
if (!DrawableComponentInfo.TryGetValue(target.Target, out var skinnableInfo))
return null;
return new SkinnableTargetWrapper