Example #1
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/UI;component/GameTable.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.BottomPlayerPanel = ((ManchkinQuest.UI.PlayerPanel)(this.FindName("BottomPlayerPanel")));
     this.TopPlayerPanel = ((ManchkinQuest.UI.PlayerPanel)(this.FindName("TopPlayerPanel")));
     this.LeftPlayerPanel = ((ManchkinQuest.UI.PlayerPanel)(this.FindName("LeftPlayerPanel")));
     this.RightPlayerPanel = ((ManchkinQuest.UI.PlayerPanel)(this.FindName("RightPlayerPanel")));
     this.MazePanel = ((ManchkinQuest.UI.MazePanel)(this.FindName("MazePanel")));
     this.StatusBar = ((System.Windows.Controls.TextBlock)(this.FindName("StatusBar")));
 }
Example #2
0
 private void AddEventHandlers(PlayerPanel playerPanel)
 {
     /*
       playerPanel.MouseEnter += delegate
       {
     if (playerPanel.Player != null)
     {
       playerPanel.Cursor = Cursors.Hand;
       playerPanel.Navigated = true;
     }
       };
       playerPanel.MouseLeave += delegate
       {
     if (playerPanel.Player != null)
     {
       playerPanel.Cursor = Cursors.Arrow;
       playerPanel.Navigated = false;
     }
       };
       playerPanel.MouseLeftButtonUp += delegate
                                  {
                                    if (playerPanel.Player != null)
                                    {
                                      var zoomedPlayerPanel = new PlayerPanel
                                                        {
                                                          Player = playerPanel.Player,
                                                          Placement = PlayerPanelPlacement.Bottom/*TODO?♥1♥,
                                                        };
                                      zoomedPlayerPanel.Update();
                                      var grid = new Grid {Background = LayoutRoot.Background};
                                      grid.Children.Add(zoomedPlayerPanel);
                                      UIElement rootVisual = Application.Current.RootVisual;
                                      var rect = new Rect(0, rootVisual.RenderSize.Height / 4, rootVisual.RenderSize.Width, rootVisual.RenderSize.Height / 2);
                                      Rect startRect = playerPanel.GetRect(rootVisual);
                                      UIManager.Instance.ShowInPopup(grid, startRect, rect);
                                    }
                                  };
     */
 }