c# - Access WPF object by string variable -
i have x listviews
in xaml form:
- name:
lvext1
- name:
lvext2
- etc...
in program can access them directly lvext1.items
or similar.
i access within function has number parameter
something like:
privat void accesslistview(string number){ return lvlext"number".items; }
in symfony (php) can this: https://stackoverflow.com/a/31142123/1092632
i realize may different, express trying do.
two ways:
use way wpf provided:
var lvlext = this.findname("lvlext" + number) listview;
var lvlext = logicaltreehelper.findlogicalnode(this, "lvlext" + number);
use array reference:
var lvlexts = new listview[3];
...
var lvlext =listview[number];
Comments
Post a Comment