UWP CustomControl as a drop container at design time -


because in uwp application there no form of layout inheritance 1 forced use customcontrol base layout.

how in uwp app can customcontrol used drop target in design mode? that, button dropped design palette becomes contained within customcontrol.

all documentation can find relates wpf app , doesn't apply uwp app.

any complete examples appreciated.

xaml:

<usercontrol x:name="usercontrol"     x:class="ids2.programbaselayout"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:local="using:ids2"     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"     mc:ignorable="d"     d:designheight="300"     d:designwidth="400" style="{binding source={staticresource programbaselayoutstyle}}" >      <grid background="{binding contentareabackground, elementname=usercontrol}">         <grid.rowdefinitions>             <rowdefinition/>             <rowdefinition height="9*"/>         </grid.rowdefinitions>         <textblock x:name="textblock" horizontalalignment="left" margin="0" textwrapping="wrap" text="{binding title, elementname=usercontrol}" verticalalignment="top" minwidth="30"/>         <frame x:name="frame" margin="0" grid.row="1"/>      </grid> </usercontrol> 

the code:

using windows.ui.xaml; using windows.ui.xaml.controls; using windows.ui.xaml.media;  // user control item template documented @ http://go.microsoft.com/fwlink/?linkid=234236  namespace ids2 {     public sealed partial class programbaselayout : usercontrol     {         public programbaselayout()         {             initializecomponent();         }          public string title         {             { return (string)getvalue(titleproperty); }             set { setvalue(titleproperty, value); }         }          // using dependencyproperty backing store myproperty.  enables animation, styling, binding, etc...         public static readonly dependencyproperty titleproperty =              dependencyproperty.register("title", typeof(string), typeof(programbaselayout), null);          public brush contentareabackground         {             { return (brush)getvalue(contentareabackgroundproperty); }             set { setvalue(contentareabackgroundproperty, value); }         }          // using dependencyproperty backing store myproperty.  enables animation, styling, binding, etc...         public static readonly dependencyproperty contentareabackgroundproperty =             dependencyproperty.register("contentareabackground", typeof(brush), typeof(programbaselayout), null);     } } 

when button drop doesn't end inside frame ends on top of control.
nice if drop limited dropping inside frame.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -