コード例 #1
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            // removes the application icon from the window top left corner
            // this is different than just hiding it
            WindowHelper.RemoveIcon(this);

            switch (_viewModel.Options)
            {
            case MessageBoxOptions.None:
                break;

            case MessageBoxOptions.RightAlign:
                WindowHelper.SetRightAligned(this);
                break;

            case MessageBoxOptions.RtlReading:
                break;

            case MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading:
                break;
            }

            // disable close button if needed and remove resize menu items from the window system menu
            var systemMenuHelper = new SystemMenuHelper(this);

            if (_viewModel.ButtonOption == WPFMessageBoxButton.YesNo)
            {
                systemMenuHelper.DisableCloseButton = true;
            }

            systemMenuHelper.RemoveResizeMenu = true;
        }
コード例 #2
0
		protected override void OnSourceInitialized(EventArgs e)
		{
			// removes the application icon from the window top left corner
			// this is different than just hiding it
			WindowHelper.RemoveIcon(this);

			switch (_viewModel.Options)
			{ 
				case MessageBoxOptions.None:
					break;

				case MessageBoxOptions.RightAlign:
					WindowHelper.SetRightAligned(this);
					break;

				case MessageBoxOptions.RtlReading:
					break;

				case MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading:
					break;
			}

			// disable close button if needed and remove resize menu items from the window system menu
			var systemMenuHelper = new SystemMenuHelper(this);

			if (_viewModel.ButtonOption == MessageBoxButton.YesNo)
			{
				systemMenuHelper.DisableCloseButton = true;
			}

			systemMenuHelper.RemoveResizeMenu = true;
		}