Blue Theme Orange Theme Green Theme Red Theme
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
Search :       Advanced Search »
Home » Blogs Home » Blog Detail

Window Object In WPF

 by Mahak Gupta on Jan 21, 2012

The Window object provides properties, methods, and events that allow the application to respond and it is used to handle interaction with the user.
Download Files: Window Object In WPF.rar
Comments: 0 Views: 684 Printable Version 

The Window object provides properties, methods, and events that allow the application to respond and it is used to handle interaction with the user. Each WPF application has a reference to a window , which is designated by the main window .We can control this setting by the MainWindow property of the Application object. In order to access the Window object, we should first give the reference of the MainWindow Object.

 

NavigationWindow nw = (NavigationWindow)MyApplication.MainWindow;

 

Here we take a simple example of window object. Here we use an event of the Window object ContentRendered, By this the Window Content Has been Rendered.

 

First we write  the following  in Window.xaml:

 

<Window x:Class="Window_Object_In_WPF.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="Window1" Height="300" Width="300" ContentRendered="OnContentRendered">

 

Then we write the following event handler in the code behind file:

 

private void OnContentRendered(object sender, EventArgs e)

        {

            MessageBox.Show("My Name is Mahak");

        }


The following Window will be appear, when we run the program:


 Window.png

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
 
What do you say about this post? Post a comment here
*Title:
*Comment:
 
Comments not available.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor

 Blogger's Profile
Age: Not Available
Location:
Title: Developer
Joined: May 09, 2010
Education: Master's Degree
 More Blogs from this Blogger
No record available
 Latest Blogs
[Video] OnClose Handler
[Video] Storing and Loading the Window and Toolbar position
The Euclidean Algorithm
Swapping Exe Process
How Exe file is Generated by VS2005 C++ Project?
What is Exe
Header files: Multiple Inclusion problem - Solution B
Header files: Multiple Inclusion problem - Solution A
Header files: Multiple Inclusion problem - Reason
Header files: Multiple Inclusion problem
View all »
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 
6 Months Free & No Setup Fees ASP.NET Hosting!
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.