c# - Why "TextWrapping" automatically add to XAML when TextBox inserted -


after drag/drop control textbox in wpf window, can see below line in xaml

<textbox ... textwrapping="wrap" text="textbox" /> 

these properties automatically insert xaml! special property inserted in xaml.

questions:

  • why these special properties (like textwrapping or text textbox) automatically add in xaml? (is there kind of attribute this)?
  • i want inherit class textbox , prevent of automatic insertion of textwrapping property. possible? (is there kind of attribute this)?
  • is there solution, select properties automatic inserted in xaml, in design mode (like textwrapping textbox)?

what want defaultinitializer defines defaults set when dragging toolbox onto design view.

[feature(typeof(mydefaults))] public partial class usercontrol1 : usercontrol {     public usercontrol1()     {         initializecomponent();     }      public class mydefaults : defaultinitializer     {         public override void initializedefaults(modelitem item)         {             item.name = "test";         }     } } 

then dragging , dropping control on form results in

<local:usercontrol1 x:name="test" width="100"/> 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -