Skip to content

Type wrapper

Nikita edited this page Jan 25, 2022 · 6 revisions

Introduction

TypeWrapper is just a convenient way to provide class type into <x:Arguments>. Good example is the MemorizedDataTemplate (link).

Usage

<!--...-->
<utils:MemorizedDataTemplate>
    <x:Arguments>
        <wrappers:TypeWrapper Type="{x:Type pages:OtherPage}"/>
    </x:Arguments>
</utils:MemorizedDataTemplate>
<!--...-->
  • Type is the desired type;
  • Parent is optional and is useful for situation described here. You should provide a reference to the existing object instance or a new one.