I was using the "commented" out code below to create BUTTONS on a TOOLBAR at runtime - worked nicely.
So I am now trying to build these buttons with tooltips as well - but when I run the code below it shows no buttons at all.
Code:
//List<String> list = new List<string>();
//list.Clear();
//for (int i = 0; i < x.Suggestions2.Count; i++)
//{
// list.Add(x.Suggestions2[i]);
//}
//ToolList.ItemsSource = list;
Code:
ToolBar tb = new ToolBar();
tb.Items.Clear();
for (int i = 0; i < x.Suggestions2.Count; i++)
{
Button ib = new Button();
ib.Content = x.Suggestions2[i];
ib.ToolTip = "tool tip " + x.Suggestions2[i];
tb.Items.Add(ib);
}
ToolList.ItemsSource = tb.ItemsSource;
//ToolList = tb; <------- I tried this first - it also did not work