c# - How do I design a window similar to VS2015's Tools->Options window? -
update: problem having have 2 different types of items in tree view. items explicitly created , creates itemssource property. selecteditem property of explicitly created treeviewitems treeviewitem, selecteditem of itemssource created item instance of object.
i'm trying design window similar vs2015's tools->options window, have treeview on left , contentpresenter (or other control?) on right can bind contentpresenter's datacontext treeview's selectedvalue, contentpresenter can somehow select it's content based on datacontext. i've tried sorts of approaches, can't right.
the datacontext on window instance of object
public class settings { public generalsettings general { get; } = new generalsettings(); public observablecollection<configuration> configurations = new observablecollection<configuration>(); public othersettings other { get; } = new othersettings(); public class generalsettings { } public class configuration { public string name { get; } = string.empty; } public class othersettings { } }
i want treeview this
general
- configutations
|- configuration1
|- configuration2
|- ...
|- configurationn
- other
so tried xaml:
<treeview> <treeviewitem header="general"/> <treeviewitem header="configurations" itemssource="{binding configurations}"/> <treeviewitem header="other"/> </treeview>
but i'm not sure how bind root treeviewitems appropriate properties.
am going wrong? suggestions?
Comments
Post a Comment