In my tabcontrol using WPF,C#.I entering text to listbox in one tabitem from the click event in tabcontrol.But the listbox doesnot display the text.When i debug i can find tht the listbox has count:1 here is the code:
namespace Tabcontrol
{
public partial class PresetTab : UserControl //3rd Tabitem ,preset.xaml.cs
{
public PresetTab()
{
InitializeComponent();
}
public void AddPresetmenu(string pMenu)
{
menubox.Items.Add(pMenu); //menubox is listbox
}
}
}
namespace Tabcontrol
{
public partial class ToolBar : UserControl
{
PresetTab tab = new PresetTab();
public ToolBar()
{
InitializeComponent();
}
public void Click(object sender, MouseButtonEventArgs e)
{
Add("TAB MENU");
}
public void Add(string menu)
{
tab.AddPresetmenu(menu); //Im calling from tabcontrol,toolbar.xaml.cs
}
}
}