Пример #1
0
        /// <summary>
        /// Set the settings for notification window
        /// </summary>
        /// <param name="helpText">This is the string to be displayed</param>
        /// <param name="helpDuration">Duration for which the notification window should be active</param>
        /// <param name="windowPosition">The position where notification window should be displayed</param>
        /// <param name="hyperLinkPath"></param>
        /// <param name="hyperLinkText"></param>
        public void SetSettings(string helpText, int helpDuration, windowStartPosition windowPosition, string hyperLinkPath, string hyperLinkText)
        {
            this.hyperLinkPath = hyperLinkPath;
            windowActive       = true;
            ContentText.Text   = helpText;
            delayTime          = helpDuration;
            windowPostionType  = windowPosition;
            dispatcherTimer.Start();

            if (hyperLinkText == null)
            {
                HyperLinkText.Visibility = Visibility.Collapsed;
            }
            else
            {
                HyperLinkText.Visibility = Visibility.Visible;
                HyperLinkText.Text       = hyperLinkText;
            }

            switch (windowPosition)
            {
            case windowStartPosition.topLeft:
                this.Left = 10;
                this.Top  = 10;
                break;

            case windowStartPosition.topRight:
                this.Left = SystemParameters.PrimaryScreenWidth - (double)GetValue(WidthProperty) - 10;
                this.Top  = 10;
                break;

            case windowStartPosition.bottomLeft:
                this.Left = 10;
                this.Top  = SystemParameters.PrimaryScreenHeight - (double)GetValue(HeightProperty) - 50;
                break;

            case windowStartPosition.bottomRight:
                this.Left = SystemParameters.PrimaryScreenWidth - (double)GetValue(WidthProperty) - 10;
                this.Top  = SystemParameters.PrimaryScreenHeight - (double)GetValue(HeightProperty) - 50;
                break;

            case windowStartPosition.center:
                this.Left = (SystemParameters.PrimaryScreenWidth / 2) - ((double)GetValue(WidthProperty) / 2);
                this.Top  = (SystemParameters.PrimaryScreenHeight / 2) - ((double)GetValue(HeightProperty) / 2);
                break;

            case windowStartPosition.windowTop:
                MoveWindow();
                break;
            }

            if (this.HyperLinkText != null)
            {
                HyperLinkText.Cursor = Cursors.Hand;
            }
            else
            {
                HyperLinkText.Cursor = Cursors.Arrow;
            }
        }
Пример #2
0
        /// <summary>
        /// Set the settings for notification window
        /// </summary>
        /// <param name="helpText">This is the string to be displayed</param>
        /// <param name="helpDuration">Duration for which the notification window should be active</param>
        /// <param name="windowPosition">The position where notification window should be displayed</param>
        public void SetSettings(string helpText, int helpDuration, windowStartPosition windowPosition)
        {
            windowActive      = true;
            ContentText.Text  = helpText;
            delayTime         = helpDuration;
            windowPostionType = windowPosition;
            dispatcherTimer.Start();

            switch (windowPosition)
            {
            case windowStartPosition.topLeft:
                this.Left = 10;
                this.Top  = 10;
                break;

            case windowStartPosition.topRight:
                this.Left = SystemParameters.PrimaryScreenWidth - (double)GetValue(WidthProperty) - 10;
                this.Top  = 10;
                break;

            case windowStartPosition.bottomLeft:
                this.Left = 10;
                this.Top  = SystemParameters.PrimaryScreenHeight - (double)GetValue(HeightProperty) - 50;
                break;

            case windowStartPosition.bottomRight:
                this.Left = SystemParameters.PrimaryScreenWidth - (double)GetValue(WidthProperty) - 10;
                this.Top  = SystemParameters.PrimaryScreenHeight - (double)GetValue(HeightProperty) - 50;
                break;

            case windowStartPosition.center:
                this.Left = (SystemParameters.PrimaryScreenWidth / 2) - ((double)GetValue(WidthProperty) / 2);
                this.Top  = (SystemParameters.PrimaryScreenHeight / 2) - ((double)GetValue(HeightProperty) / 2);
                break;

            case windowStartPosition.windowTop:
                MoveWindow();
                break;
            }
        }
        /// <summary>
        /// Set the settings for notification window
        /// </summary>
        /// <param name="helpText">This is the string to be displayed</param>
        /// <param name="helpDuration">Duration for which the notification window should be active</param>
        /// <param name="windowPosition">The position where notification window should be displayed</param>
        /// <param name="hyperLinkPath"></param>
        /// <param name="hyperLinkText"></param>
        public void SetSettings(string helpText, int helpDuration, windowStartPosition windowPosition, string hyperLinkPath, string hyperLinkText)
        {
            this.hyperLinkPath = hyperLinkPath;
            windowActive = true;
            ContentText.Text = helpText;
            delayTime = helpDuration;
            windowPostionType = windowPosition;
            dispatcherTimer.Start();

            if (hyperLinkText == null)
                HyperLinkText.Visibility = Visibility.Collapsed;
            else
            {
                HyperLinkText.Visibility = Visibility.Visible;
                HyperLinkText.Text = hyperLinkText;
            }

            switch (windowPosition)
            {
                case windowStartPosition.topLeft:
                    this.Left = 10;
                    this.Top = 10;
                    break;
                case windowStartPosition.topRight:
                    this.Left = SystemParameters.PrimaryScreenWidth - (double)GetValue(WidthProperty) - 10;
                    this.Top = 10;
                    break;
                case windowStartPosition.bottomLeft:
                    this.Left = 10;
                    this.Top = SystemParameters.PrimaryScreenHeight - (double)GetValue(HeightProperty) - 50;
                    break;
                case windowStartPosition.bottomRight:
                    this.Left = SystemParameters.PrimaryScreenWidth - (double)GetValue(WidthProperty) - 10;
                    this.Top = SystemParameters.PrimaryScreenHeight - (double)GetValue(HeightProperty) - 50;
                    break;
                case windowStartPosition.center:
                    this.Left = (SystemParameters.PrimaryScreenWidth / 2) - ((double)GetValue(WidthProperty) / 2);
                    this.Top = (SystemParameters.PrimaryScreenHeight / 2) - ((double)GetValue(HeightProperty) / 2);
                    break;
                case windowStartPosition.windowTop:
                    MoveWindow();
                    break;
            }

            if (this.HyperLinkText!=null)
                HyperLinkText.Cursor = Cursors.Hand;
            else
                HyperLinkText.Cursor = Cursors.Arrow;
        }