c# - WPF Event to Command add to control from Codebehind -
i'm using event command explaind here: http://nerobrain.blogspot.nl/2012/01/wpf-events-to-command.html
i try add controls codebehind, since dynamically have add them depending on data db. how perform same thing below codebehind
how add "local" part in codebehind?
update:
this problem i'm trying solve, i'll try summerizes shortly :)
the user supposed leave feedback after usage of application.
feedback information can consist of multiple questions can either
- single choice
- multiple choice.
so 1 feedbackset can have several feedbackgroups can either have single choice feedbackcodes or multiple choice feedbackcodes or have subgroups of feedbackgroups/feedbackcodes
- a single choice result in combobox
- a multiple choice result in listbox
- a subgroup generate treeview
the model(shortend code):
public class feedbackset { public int id{get;set;} public string name{get;set} public list<feedbackgroup> groups{get;set;} } public class feedbackgroup { public int id{get;set;} public string name{get;set;} public feedbackgrouptype type public list<feedbackgroup> groups{get;set;} public list<feedbackcode> codes{get;set;} } public class feedbackcode { public int id{get;set;} public string name{get;set} } public enum feedbackgrouptype { subgroup, single_choice, multi_choice }
so can different number , types of controls, based on feedbackset consist of. want id of each selected feedbackcode, i'm trying bind selecteditem event on different controls bind same command.
damn it's hard explain :)
you can implements own custom controls add "local" part mentioned in xaml code.
then create new instances of these controls instead of default ones code behind.
Comments
Post a Comment