public MainPage()
{
InitializeComponent();
this.DataContext = new ViewModel.ViewModel();
this.olapClient.Loaded += (send, e) =>
{
this.olapClient.CubeDimensionBrowser.MouseMove += new System.Windows.Input.MouseEventHandler(CubeDimensionBrowser_MouseMove);
};
}
void CubeDimensionBrowser_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
{
if (this.olapClient.CubeDimensionBrowser.ItemsSource is MetaTreeNodeCollection)
{
object obj = null;
if (e.OriginalSource is TextBlock)
{
var a = (e.OriginalSource as TextBlock);
//ToolTipService.SetToolTip(a, a.Text);
var itemSource = (this.olapClient.CubeDimensionBrowser.ItemsSource as MetaTreeNodeCollection)[0];
foreach (var item in itemSource.ChildNodes)
{
if (item.Caption == a.Text)
{
obj = item;
break;
}
}
if (obj != null)
{
TextBlock tb = new TextBlock();
tb.Text = (obj as MetaTreeNode).NodeType + " : " + (obj as MetaTreeNode).Caption;
ToolTipService.SetToolTip(a, tb);
}
else
{
if(a.Text == "Growth in Customer Base")
ToolTipService.SetToolTip(a, "Shows the KPI for Growth in Customer Base");
}
}
}
}
|