예제 #1
0
        private void TileKObject_ShowFlyout()
        {
            if (this.Info.hasflyout && tileKObject.FlyoutContent != null)
            {
                if (flyout != null && flyout.IsVisible)
                {
                    flyout.Activate();
                    return;
                }
                flyout        = new FlyoutWindow(Info.Name);
                flyout.Width  = tileKObject.FlyoutContent.Width;
                flyout.Height = tileKObject.FlyoutContent.Height;
                switch (side)
                {
                case AppBarSide.Left:
                    flyout.Left = this.PointToScreen(new Point(0, 0)).X + this.ActualWidth;
                    break;

                case AppBarSide.Right:
                    flyout.Left = this.PointToScreen(new Point(0, 0)).X - flyout.Width - 3;
                    break;
                }
                flyout.Top = this.PointToScreen(new Point(0, 0)).Y;
                flyout.ContentGrid.Children.Add(tileKObject.FlyoutContent);
                flyout.Show();
            }
        }
예제 #2
0
        private void TileObject_ShowFlyoutEvent()
        {
            if (this.Info.hasflyout && tileObject.FlyoutContent != null)
            {
                if (flyout != null && flyout.IsVisible)
                {
                    flyout.Activate();
                    return;
                }
                flyout = new FlyoutWindow(Info.Name);
                switch (side)
                {
                case AppBarSide.Left:
                    flyout.Left = this.PointToScreen(new Point(0, 0)).X;
                    break;

                case AppBarSide.Right:
                    flyout.Left = this.PointToScreen(new Point(0, 0)).X;
                    break;
                }
                flyout.Top = this.PointToScreen(new Point(0, 0)).Y;
                System.Windows.Forms.Screen screen = Utils.GetScreenFromName(SidebarWindow.sett.screen);
                flyout.ContentGrid.Children.Add(tileObject.FlyoutContent);
                flyout.Show();
                if ((flyout.Top + flyout.Height) > screen.WorkingArea.Height)
                {
                    flyout.Top = screen.WorkingArea.Height - flyout.Height;
                }
            }
        }