コード例 #1
0
ファイル: Window1.xaml.cs プロジェクト: taftazaniadi/LearnWPF
        //private void CenterWindowOnScreen()
        //{
        //    double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
        //    double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
        //    double windowWidth = this.Width;
        //    double windowHeight = this.Height;
        //    this.Left = (screenWidth / 2) - (windowWidth / 2);
        //    this.Top = (screenHeight / 2) - (windowHeight / 2);
        //}

        private void Add_Click(object sender, EventArgs e)
        {
            string title = this.TitleTextBox.Text.Trim();

            //string message = this.MessageTextBox.Text.Trim();

            if ((title != string.Empty) /* && (message != string.Empty)*/)
            {
                // The title and message are both not empty.

                // Add the new title and message to the TaskbarNotifier's content.
                // this.taskbarNotifier.NotifyContent.Add(new NotifyObject(/*message,*/ title));


                // Clear the textboxes.
                this.ClearTextBoxes();

                // Tell the TaskbarNotifier to open.
                //this.taskbarNotifier.Notify();
                //this.taskbarNotifier.Topmost = true;

                notificationHandler.Add(new NotifyObject(title));
            }
        }