Esempio n. 1
0
 public AboutWindow(App application, MainWindow Owner) : base(Owner, application.Language.About)
 {
     BrdrBrush     = new SolidColorBrush(Color.FromRgb(172, 172, 172));
     app           = application;
     Icon          = ImageConverter.BitmapSourceFromMessageBoxImage(MessageBoxImage.Information, 16, 16);
     MinHeight     = 436;
     MaxHeight     = MinHeight;
     MinWidth      = 376;
     MaxWidth      = MinWidth;
     ShowInTaskbar = false;
     Grid1         = new Grid()
     {
         Margin = new Thickness(0, 0, 0, ButtonBarHeight)
     };
     Content  = Grid1;
     ButtonOK = new Button()
     {
         Name = "ButtonOK",
         HorizontalAlignment = HorizontalAlignment.Center,
         VerticalAlignment   = VerticalAlignment.Center,
         Content             = new TextBlock()
         {
             Text = "OK"
         },
         Width       = 85,
         Height      = 25,
         Background  = app.Resources["BackgroungBrush"] as Brush,
         BorderBrush = BrdrBrush,
         IsDefault   = true
     };
     ButtonOK.Click += new RoutedEventHandler(ButtonClick);
     AddToButtonBar(ButtonOK);
     InitializeComponent();
     SourceInitialized += AboutWindowSourceInitialized;
 }
        private void CreateSubMenuProgram()
        {
            MenuItem MenuItemProgram = new MenuItem()
            {
                Header = app.Language.Program
            };

//
            MenuItemSettings = new MenuItem()
            {
                Header = app.Language.Settings,
                Name   = "MenuItemSettings",
                Icon   = new Image()
                {
                    Source = ImageConverter.IconToBitmapFrame(CW.Properties.Resources.Parameters)
                }
            };
            MenuItemSettings.Click += MenuItemShowChildWindowClick;
            MenuItemProgram.Items.Add(MenuItemSettings);
//
            MenuItemProgram.Items.Add
            (
                new Separator()
            );
//
            MenuItemInfo = new MenuItem()
            {
                Header = app.Language.About,
                Name   = "MenuItemInfo",
                Icon   = new Image()
                {
                    Source = ImageConverter.BitmapSourceFromMessageBoxImage
                             (
                        MessageBoxImage.Information,
                        16,
                        16
                             )
                }
            };
            MenuItemInfo.Click += MenuItemShowChildWindowClick;
            MenuItemProgram.Items.Add(MenuItemInfo);
//
            MainMenu.Items.Add(MenuItemProgram);
        }