locked
Clonning a Control RRS feed

  • Question

  • Hi,

    How can i clone a object?

    Or, just get all xaml code from an object ?

    tks

     

     

    Monday, February 26, 2007 2:22 PM

Answers

  • There is no ability to "clone" an arbitrarty "WPF/E" object. You can create some sort of "component" that has a set of "visuals" defined via XAML. Then you can use createFromXaml and then create your own clone method.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Monday, February 26, 2007 7:52 PM

All replies

  • The simplest way is to have the original assets of an object in a XAML file and then use creatfromXAML to instantiate. Note that before creating from XAML you will need to adust the names of assets on the object.

    Monday, February 26, 2007 5:43 PM
  • Hi Barak,

    The only way to get the xaml from an object is keeping the original xaml that creates the object  ?

    I dont know what object i will clone. The user will choose. So, i have to keep a copy of all xaml from all objects ?

    tks

     

     

     

    Monday, February 26, 2007 6:09 PM
  • There is no ability to "clone" an arbitrarty "WPF/E" object. You can create some sort of "component" that has a set of "visuals" defined via XAML. Then you can use createFromXaml and then create your own clone method.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Monday, February 26, 2007 7:52 PM