void Windows_Loaded(object sender, RoutedEventArgs e) { this.mouseClickManager = new MouseClickManager(captionBar, 300); this.mouseClickManager.Click += new MouseButtonEventHandler(this.mouseClickManager_Click); this.mouseClickManager.DoubleClick += new MouseButtonEventHandler(this.mouseClickManager_DoubleClick); //this.scrollcontent.HorizontalScrollBarVisibility = this.HorizontalScrollBarVisibility; //this.scrollcontent.VerticalScrollBarVisibility = this.VerticalScrollBarVisibility; this.captionText.Text = this.caption; this.ToolBar.MouseLeftButtonDown += new MouseButtonEventHandler(ToolBar_MouseLeftButtonDown); minButton.Click += new RoutedEventHandler(this.minButton_Click); if (!this.showMinButton) { minButton.Visibility = Visibility.Collapsed; } maxButton.Click += new RoutedEventHandler(this.maxButton_Click); if (!this.showMaxButton) { maxButton.Visibility = Visibility.Collapsed; } closeButton.Click += new RoutedEventHandler(this.closeButton_Click); this.DefineDragEvents(); this.DefineResizeEvents(); Canvas.SetZIndex(this, currentZIndex); if (this.SetZIndex != null) { this.SetZIndex(this, EventArgs.Empty); } /**************************************************************************************************/ if (AllMaximized == true) { DraggingEnabled = false; this.initialWindowSize.Width = !double.IsNaN(base.Width) ? base.Width : base.ActualWidth; this.initialWindowSize.Height = !double.IsNaN(base.Height) ? base.Height : base.ActualHeight; this.initialBarLocation.X = Canvas.GetLeft(this); this.initialBarLocation.Y = Canvas.GetTop(this); if (this.Maximized != null) { this.Maximized(this, EventArgs.Empty); } } }