Home > Software engineering >  Does basic controls (like Button, TextBlock) have xaml files implementation?
Does basic controls (like Button, TextBlock) have xaml files implementation?

Time:09-24

I am new to UWP app development and am curious how basic controls are implemented. Do these primitive controls like TextBlock, Button, etc have xaml file implementation or do they only have class implementation? And if they have xaml implementation, how is that control built up? (using which primitive elements). Basically, I am trying to understand what is the most primitive element in xaml? We built our using Button, TextBlock, etc. How are they built? Thanks

Update: adding image to show the options on context menu in VS document layout

enter image description here

CodePudding user response:

Button has Xaml template but TextBlock does not.

If you want to know whether a control could be customized or it is built by other controls, there is a simple way you could check it. You could write down the control in the Xaml, then you could find the control in the Document Outline Window in Visual Studio. Right-click on the target control and you will see the menu. Choose Edit Style -> Edit a Copy and VS will create a default style of the target control automatically. The style will contain the ControlTemplate of the target control(if it has) and the style settings. The ControlTemplate shows how the control is built from other controls.

  • Related