Sample Data Binding in Expression Blend

Sample data binding:

Today, we are going to see the magic of expression blend. That how simply an application can be created in blend studio.
Let me tell you the basic about the application. The application is about the creating a list of products or list of any thing. Now it depends upon us that how wisely we make use of tool and logic to output a fascinating application.
This application will give the facts about some things. where picture and some other information will be placed

Designer: 
The designer makes the application according to his or her own perspective. The sample data is useful creating a beautiful appearance of controls that will display  data that you might not access at design time. you can create sample data in the form of class to, that will be in the XAML file.

1- First of all open an application in c# giving it any name. I 'm making 8facts application. That will give some information about little things. Numbers and their description.  Now open the application.


2-Here is have set two images 8fact and a quote that can be applied by <image source="\path" />
There appears two pictures, that are seen in the picture given below.


3-Now open the blend studio by right click the application name in solution explorer.Then click open in blend. There opens blend studio.





5- Then click on the sample value data.and create new item. 


                                                               6- Click the ok button.



7- Now in the collection folder there are options to create as many properties as required by clicking the plus sign.Which is called sample property. 




 8- I have created three properties. One for the numbers, description and other is for the images. That can be called thumbnail. In the image property i have added png format pictures.



9-Drag the collection folder on the cell phone in mainpage.xaml. There will appear pictures with some names.


10- Now in order to change the values of these property. Click the sample view data. A screen will appear where the changes can be made about the values.


11-Here's the screen that also have the option of numbers. The number entered here. only that much of the information will be displayed on the phone. 


12- Here is the application is ready. That can be run on the emulator.
and enjoy the small application on the sample data binding.


Problem:
There comes a problem that when these properties are placed on the phone. The text if is a long sentence will not appear on the screen it will go into the phone sides. So the solution to this problem is simple. 
Use text wrapping property. This can be done by right click the textbox then click the view source.
The code will appear add textwrapping="wrap". That will display all the content in lines.


 Other technique is that don't use the  simple way to manipulate text from the front side and made changes in the text. In stead always use sample data value to make change in the values. If that method is used all the values will be changed. So avoid that ways of changing any value in the text.



Comments

Popular posts from this blog

How to move an object in Unity 3D

Input.Getaxis, OnMouseDown, GetComponent< > - Unity Scripts

Vector Math - Unity