DEV Community

amirkhansinga
amirkhansinga

Posted on

Can we add source code inside a Button?

You can add source code inside a Button using a Repeater.

lets add source code to a button

<!--Add the following to the beginning of your button--> [[source:https://developer.microsoft.com/en-us/windows/uwp/controls]]<!--Add the following to the end of your button-->

Markup:

StackPanel-- Div for adding a Button using Upper and Lower StackPanel as a container

Command-- Command is used to execute a method from the code behind. In our case it is used with calling method from code behind.
Right click on Command Textbox and select command from drop down menu. In this case we have used a pointer command that repeats a code inside a StackPanel.

Information that I Got: https://www.automaticchina.com/

Discussion (0)