/// <summary> /// Creates one instance of the top most menu /// </summary> /// <param name="center">The Menus center</param> /// <param name="angle">The angle of the menu</param> public IndividualMenu BuildMenu(Point center, double angle) { ScatterViewItem item = NonMovingItemFactory(center, angle); IndividualMenu sideMenu = new Menu.IndividualMenu(Catagory.ReadFile("Resources/Information/Top.xml"), AddAnimation(item)); MenuList.Add(sideMenu); TextBlock block = new TextBlock(); block.Text="Touch Here to Begin"; block.FontSize = 35; ScatterViewItem touchme = NonMovingItemFactory(center, angle); touchme.Content = block; touchme.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center; touchme.Focusable = false; touchme.Width = sideMenu.Width; touchme.Height = sideMenu.Height; scatter.Items.Add(touchme); Canvas canvas = sideMenu.DrawMenu(); item.Content = canvas; item.Background = Brushes.Transparent; scatter.Items.Add(item); ElementMenu historyMenu = new ElementMenu(); TransformGroup transform = new TransformGroup(); transform.Children.Add(new ScaleTransform(-1, -1)); transform.Children.Add(new TranslateTransform(sideMenu.Width * 0.5 + 1.7 * MenuTileSize, 2.2 * MenuTileSize)); historyMenu.RenderTransform = transform; historyMenu.ActivationMode = ElementMenuActivationMode.AlwaysActive; sideMenu.AddUpListenerToButtons(new EventHandler<TouchEventArgs>(TouchUpMenu)); canvas.Children.Insert(0, historyMenu); return sideMenu; }
/// <summary> /// binds the history information to the appropriate menu /// </summary> /// <param name="container"></param> /// <param name="menu"></param> private void SetUpHistory(SurfaceListBox container, IndividualMenu menu) { //2.22222 is the inverse of the scaling factor used in moveHistory 35 was picked for looks so the menu doesn't over lap the ItemMenu container.MaxWidth = menu.Width * 2.2222- 35; System.Windows.Data.Binding bind = new System.Windows.Data.Binding("History"); bind.Source = menu; container.SetBinding(LibraryBar.ItemsSourceProperty, bind); }