// change this to get the appropriate layer you want
var layer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault();
// select it in the TOC
List<Layer> layersToSelect = new List<Layer>();
// now execute the layer properties command
var wrapper = FrameworkApplication.GetPlugInWrapper("esri_mapping_selectedLayerPropertiesButton");
var command = wrapper as ICommand;
if (command == null)
// execute the command
Thanks for the solution. Its working. I was using same approach to select layer on map.
After selection I tried PropertySheet.ShowDialog method. Thus I was able to open layer properties dialog but page binding was not happening.
I tried passing DAML id of layer property sheet then null for default page and Layer which is selected as a object parameter.
Any Idea if I want to use that approach what parameters to pass for page binding? I know that PropertySheet is mainly used for customization but I was wondering if I can pass some parameter for layer page binding to make that working.
The reason behind why I want to use property sheet is that I want to programatically open Layer properties window and programetically close that too after its opened. I am actually measuring time to open and close the layer property window.