0

How do I add button dynamically using C# on ArcGIS?

I can create that using XAML, but I can't write that on C#, I checked on the website on ArcGIS, they allowed to add graphics dynamically, but there is no sample to show how to add controls such as button dynamically.

Can anyone provide me some sample code?

Thanks

2 Answers 2

1

Add an ElementLayer to your map (ether in xaml or in code ), then add your button to the element layer.

MyMap.Layers.Add( new ElementLayer() { id="myElementLayer" } )

// create your button.....

MyMap.Layers[ "myElementLayer" ].Add( myButton );

there is an online sample here

Sign up to request clarification or add additional context in comments.

Comments

0

Use code behind to add the button during runtime. Anything you do in XAML can be done in code behind.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.