Tuesday, 25 August 2015

Page navigation

Today let us discuss how to navigate from one page to the other page. To navigate from the page it is nothing but we should perform some specific action. We can do this by generating an event. We can generate an event with some particular control. So while we assign an event to the control the page should be navigated. For this we need a control in order to perform some action and we also need a new page. We can do this task with the help of a button. The default event of button is click. So while we click on the button the page should be navigated from one page to the other page. For this we need a button and a new page. 



  • Open visual studio and create a new blank application.
  • Drag and drop a button and edit the contents in property window.
  • To add a new page to your application just click on solution explorer window and right click on your project name. 
  • Select add option and click on add new item After clicking on add new item a page with list of templates can be seen. 
  • We can select any kind of template regarding your application. 
  • Simply select blank page and you can also edit the name of your new page. 
  • In your tool you can see new page with a blank design page. 



To navigate from mainpage to the blank page generate an event to the button by clicking on event symbol in properties window. It navigates to the code behind file. 
In your button click event add the below code 

this.frame.navigate(type of(Blankpage1)); 

                        

Here in the above code this frame(mainpage) is navigated to the other page, the page type is Blank page. Execute the code and when you click on button the page is navigated from main page to blank page. 







Monday, 24 August 2015

Button click event

We already discussed  how to dspaly the text written in the textbox to the We created default event for the textbox in order to display the text. Now let us discuss about button control

It is mainly used to communicate in the application. When we use button event  it is to performs other actions in the user interface. The default button control event is click. When we generate click event it is nothing but with the help of mouse button we should perform the action. We can also set different properties to the button. While you change the layout in your design it reflects in your XAML code. To change the color of the button it can be done in properties window. Similar to the textbox and textblock we can edit the whole properties of the button control.

In my recent blog we displayed the input text given from textbox to textblock.In the same way when I click the button the text should be displayed in the textblock. It is simple. Just go through with the below steps.


Go through with the design of  button, textbox and textblock

  • Open visual studio and create new project
  • Add the controls required to the design. Here we need one button, textbox and a textblock
  • We can edit the properties by pressing F4 with respect to the control. Please give a name to the control so that you can access the control in code behind file.


To generate click event for a button go to the properties of the button. Press on thunder symbol and double click on click event. It navigates to the code behind file. 



In the button click event just add the similar code which is used to display the text written in textbox to the textblock

text_output.Text=text_input.Text;


Note : Just check your names of the controls before you compiling the code.

Saturday, 22 August 2015

To display the text in the text block.

Let us discuss how to display the text in the text block when the input given in text box

As we already know the textbox is to input some text. We can edit our text in the textbox. we can also pass our text written in textbox. As we know the name and text can also be edited in properties window. This was discussed in the previous blog. We can also edit the properties and change the default values in the properties window. The name assigned for the textbox is mainly used in the code behind file. With this particular name we can manage functionalities of the particular control. 



For example : If you assign a name of your textbox as textinput. We should use the name of the textbox in the code behind file. in this way every control has name property. We should enter name of the control in order to access in the code behind file.


  • Open Visual studio from start menu
  • Start new project and select windows store applications in C# tab.
  • We can also edit the name and location of the particular project. To do this just click on browse and select the desired location.
  • After selecting particular project open the solution explorer in order to open the designer page.
  • Click on MainPage.XAML as it is the root page of the application in your project.
  • To display the text in the textblock we need two controls. They are textbox and textblock.
  • Just drag and drop these controls to your designer 


You should edit the name of your controls in properties window. In order to display the text written in textbox we should generate an event. Press on thunder symbol in your properties window or else you can just double click on your textbox control. When you double click on your control it navigates to the Mainpage.XAML.CS page which is nothing but the code behind file. You can see the below text while you double click on your textbox control. The default event of text box is textchanged.




This event can also be generated in your properties window. Click on thunder symbol and you can see the list of the events of the particular control. In order to display the text written in textbox we should generate textchanged event in the list. Just place your cursor and you can directly double click on the empty box else you can add some text and double click with your mouse.


In between the braces you should enter some code in order to display your text in text block.

blockoutput.Text = textinput.Text; //To display the text written in textbox

Note : The name of my text block is blockoutput

Output
                          

Friday, 21 August 2015

Diseases - Be careful

The disease is a harmful condition mainly affects the organisms of the living things. Humans also get effected with diseases and in the same time animals, trees also be effected with the diseases. It is an abnormal condition of a particular part of our body resulting from various causes and reasons. in early days the people don't even know what are diseases. The people in that days used to stay in a situation with out any hospital. Because the food habits and the way of living made it possible. The people in less number get effected with diseases. Some people even treat the person effected with disease with out any knowledge of science and the treatment got successful. This is because in that days the people lived with out using technology. So they survived for many years compared to the present situation.



Every disease has a cause. A disease can be a virus, bacteria, fungi, and worms. These tiny organisms mainly affects our cells in our body. Our human body can fight upto some extent with these small bacteria. If these virus has good strength even our body can't fight against the virus. This makes the person to fall ill. The virus spreads in our body. After certain medicine if the virus get killed then we regain our activeness. Until then we should struggle.  These diseases can be infectious and non infectious. Infectious is nothing but it spreads or transfers from one organism to another organism. Some of the infectious diseases are cold, cough, rabies, chicken pox etc. Non infectious is quite opposite of the infectious disease. It cannot be spread or transferred from one organism to the other. Examples of this non infectious diseases are diabetes,cancer, asthma etc. 



We should be careful with this infectious diseases because it can be passed or spread from different ways. While we talk with the person closely while he is affected with cold there is a chance of being effected with the same disease. Before we get affected with diseases we can find some symptoms. A symptom is something the patient who effected with the disease, that person can detect it. In our universe there are many uncountable diseases exist. Most of them are curable. Some of them are not curable. Doctors can't even find a perfect medicine to that particular diseases. Every disease has its own symptoms and signs in order to identify the disease. Mostly doctors find the diseases based on the signs, cause and symptoms of the individual. When a person is affected with diseases his body doesn't co-operates for any kind of action. He/She remains ill until the disease get cured..

Deficiency in diet also cause diseases. They can be cured by having proper diet and good exercise. The people also should take proper precautions in order to get rid of the disease. Diseases can be of many types. They are caused for many reasons. But all are harmful and dangerous. They lead to illness and sickness. Because of this technology increasing of diseases started. Radiation, pollution, heavy population, improper sanitation are some of the causes of diseases. The people mostly keep faith on doctors until the disease get cured. Even hospitals earn huge profits because number of patients also increased. Proper health and diet with good exercise can keep a man healthy.


Start using Visual studio

Today let us discuss about a sample project in order to display the text written in text box
  • Open your visual studio from the start menu
  • Create new project with your desired project name.
  • In order to design your project open MainPage.Xaml page. Just open solution explorer tab and double click on main page. As you know Main page is the root page of the project. The execution of the app starts from this page.
  • After a double click on main page we can see a designer page with black color. It is a grid and we can also change the color of our grid. This grid is also one of the control of windows runtime application.

So our task is to display the text when we input our text in textbox. This is done in the following way.

In order to display our text we need two controls.
  • Textbox - This control is mainly used to input text or to edit our text. We can also write multiple line in this textbox
  • Text block - It is mainly used to display text. We cannot edit text while we place text block in your design

 
We can drag and drop these controls to our design if not we can just add controls using XAML code. In down under the design we can find this XAML file. After adding controls to our design we change edit/modify the names and properties of the particular control. Press F4 to access the properties of the particular control.

 

The highlighted textbox is the control we can drag & drop to the design. In the above image we can see how to change the name of the control. We can directly add our text in textbox with the help of properties. In the Text property when we write the text & press enter, the change is reflected in the designer. The name assigned in the properties can be used in the code behind file.



In the above diagram we can see how to increase the font size of the text block control. The highlighted text is the XAML code. When we drag and drop our control it automatically generates XAML code. This is the advantage of Visual Studio tool. The change is reflected in the designer. Observe the things carefully.

Thursday, 20 August 2015

Spring - A pleasant and delighted season


Spring season starts after winter and before summer. It begins from the middle of February and completes in the middle of April. It is the best season of the year. Most of the people are fond of this season. They enjoy a lot with good and pleasant climate.  Spring is neither hot nor cold. It is very delightful. It is good for health. While we walk in the morning we feel very happy and our mind goes pleasant. We can say that this spring season is the favorite season of poets. Because they describe very nicely in their poems about this spring season. This season is called the queen of all seasons. Day and night both become very pleasant and cool. Days and nights become almost same length, neither too short nor too long.  Sky looks very clear and wind becomes very cool and refreshing.


The people mostly like this spring season because in this season the climate will be very pleasant. The temperature in this season remains constant. In spring, the trees bring new leaves on their branches. Spring is the season of joy and happiness for all the living beings like tree, plants, flowers, animals, birds, human beings, etc because it is neither hot nor cold. Many new variety of flowers grow in this season because of the pleasant climate. We can see pleasant nature when fields grow new grass and the entire nature becomes green and it looks fresh. This makes the main difference between the rest of other seasons.Only in this spring season we can see crops fully ripen with fruits and flowers. The farmers also feel happy if the fields grow within the time. 


We should face problems even in this spring season. As it is the end of winter season and start of summer season, it is the more sensitive season to the health. We should not neglect our health.  Small pox, chicken pox and measles are quite common in this season. So the people should be very careful in this season too. We have a saying in English "Prevention is better than cure". So we should take some precautions in order to get rid of this diseases in this season. 

Spring season is very delighted and a pleasant season. In winter season we face very cool weather. We cannot even survive in some of the regions of northern hemisphere because of less temperatures. Even some people die due to low temperatures in some regions. They can't tackle the cool weather so lot of issues happens in this season. Coming to the summer season it is quite opposite to winter season. We should face very high temperature in this season. The people face many difficulties during this season.  They should take care of their health particularly in this season.  In rainy season we feel bad because of dirty and muddy roads because of rainfall. The only season with less complaints is spring season.


Intro to Visual studio

Today let use discuss about a sample application. In our application we can include many controls from our toolbox. While we add these elements we can edit the properties of that particular control and we can also generate events to that control
 
First let us discuss about properties and events with respect to control.
Properties of a particular control is available to describe a control. It depends upon the user to edit some particular control. It can be done in the following ways.
  • On the main menu, you can click View -> Properties Window
  • On the grid, you can right-click anything (either the grid itself or any control positioned on it) and click Properties
  • The shortcut to display the Properties window is F4
  


Events of the controls is the action or event generated by the particular control at runtime. Most of the controls have default event.
 
  • In properties window we can see thunder symbol and when we click on this symbol we can generate events according to the applications
Just double click or write the name of the event and press enter. This takes directly to the code behind file or .cs file where you can include the whole functionalities and logical operations.
To build our application move your cursor to Build option and click on Build option. It compiles code file which are changed. Build solution only builds those projects which have changed in the solution, and does not affect assemblies that have not changed. Assemblies are nothing but the code generated after successful compilation.


After Building our application we can run or deploy our application by clicking on local machine with green color play symbol and run the app.