C# Object Instantiation Question
<p>I would appreciate some help refactoring my code. If I pass an instance of an object to another object instance is there any way to reinstantiate that instance without losing the reference?</p>

<p>Here is a simplified version of the problem I have:</p>

<pre><code>    public class Program
{
    static void Main(string[] args)
    {
        Animal myPet = new Cat();
        House myHouse = new House(myPet);
        House petDayCare = new House(myPet);

        Console.WriteLine(String.Format("My pet has {0} flea(s)", myPet.Fleas.ToString()));
        myHouse.AddFlea();
        Console.WriteLine(String.Format("My pet has {0} flea(s)", myPet.Fleas.ToString()));
        petDayCare.AddFlea();
        Console.WriteLine(String.Format("My pet has {0} flea(s)", myPet.Fleas.ToString()));
        myHouse.GetNewPet();
        Console.WriteLine(String.Format("My pet has {0} flea(s)", myPet.Fleas.ToString()));

        Console.ReadLine();
    }
}

public class House
{
    Animal _currentPet;

    public House(Animal currentPet) {
        _currentPet = currentPet;
    }

    public Animal CurrentPet {
        get { return _currentPet; }
        set { _currentPet = value; }
    }

    public void AddFlea() {
        _currentPet.Fleas += 1;
    }

    public void GetNewPet() {
        Animal rover = new Dog();
        rover.Fleas = 100;
        _currentPet = rover;
    }

}

public abstract class Animal {

    int _fleas;

    public int Fleas {
        get { return _fleas; }
        set { _fleas = value; }
    }

    public abstract string GetSound();

}

public class Cat : Animal
{
    public override string GetSound() {
        return "Meow";
    }
}

public class Dog : Animal
{
    public override string GetSound()
    {
        return "Woof";
    }
}
</code></pre>

<p>Can myPet.Fleas = 100 in Program after calling GetNewPet()?</p>

<p>If I want to change the underlying type of object instance can I do that? If not, does anyone have any refactoring suggestions?</p>

<p>I will try and describe the details of the actual program structure.</p>

<p>I am creating a WPF Wizard.</p>

<p>That Wizard has steps.</p>

<p>When I start the Wizard an instance of the WizardViewModel class is created.</p>

<p>WizardViewModel class has an instance of ObjectX (an object whoes properties I want to modify and then return the object when the wizard is complete).</p>

<p>Each step in the wizard is an instance of the WizardPageViewModelBase class which is passed an instance of ObjectX in the constructor.</p>

<p>WizardViewModel has a list of WizardPageViewModelBase objects (one object instance for each wizard step).</p>

<p>So as long as I am only changing the properties of the ObjectX instance in each wizard step (WizardPageViewModelBase object instance) then the object that is returned by WizardViewModel works fine.</p>

<p>However in step 1 of the wizard I want to change the underlying type of ObjectX depending on what the user selects from a listbox. If I change the instance (as I do in GetNewPet() above) the reference to the ObjectX instance in WizardViewModel is lost.</p>

<p>Apologies if this makes no sense, I tried my best to structure the question in a way that can be answered...</p>
