c# - Is there an alternate to TemplatePartAttribute in UWP? -
it took me bit of time discover this, designer-specific attributes templatepart
causing issues release build of uwp application.
applying attribute controls using reflection.
[templatepart(name = part_panel, type = typeof(panel))] public class myawesomecontrol : control { ... }
and build output gives me this:
warning : type 'windows.ui.xaml.controls.panel' not included in compilation, referenced in type 'myawesomecontrol'. there may have been missing assembly.
if want build work, have exclude attribute. however, defeats purpose of control library. users of library not know panel
name part_panel
required in template of myawesomecontrol.
is there solution this? have enable reflection type allow design-time attributes through?
i aware of rd.xml
file can embedded in project. however, if <type name="windows.ui.xaml.controls.panel" ... />
included, doesn't mean i'm telling compiler exclude panel .net native optimization?
this unfortunate bug in version of .net native tools (ilc.exe) you're running on. attribute supported of update 1 release of visual studio. can rc here: https://www.visualstudio.com/en-us/news/vs2015-update1-vs.aspx
you can safely ignore warning if you're stuck using older tools.
Comments
Post a Comment