You are here: Home Blog Tag: XAML

Tag: XAML

2008.07.14 06:13:09
admin

Here is the picture guide on how to do data binding between two elements using Microsoft Expression Blend 2. In this example, I am showing how to bind between a Slider and a Circular Marker.

Step1: Select the element you would like to bind from. Example below shows how to browse to the Circular Marker element.

data binding blend 2 step 1

Step 2: Select the property of the element you want to bind from. The example below shows that the value property of Circular Marker will be binded.

Step 3: Click on the "Advanced Property Option" from the value property

 

data binding blend 2 step 2

p>Step 4: Select "Data Binding" from the "Advanced Property Option"

 

 

data binding blend 2 step 3

Step 5: From the Create Data Binding Menu, select "Element Property" Tab, then browse to the element you want to bind to. After that select the property of the element you want to bind to.

 

data binding blend 2 step 4


  Expression Blend | XAML
Comments 0Hits: 3245  

2008.06.26 06:21:48
admin

Lately there are numbers of sending email asking how to auto resizing the gauge , So i have decided to post a solution here .

There are couple of way how this can be done , but i will post a solution which i have posted in the forum .

and i will described how it works here :

1. We create a user control call MyGauge , in the MyGauge override the OnMeasure method .

private Size _oriSize;
public MyGauge()
{
InitializeComponent();
_oriSize = new Size(this.Width, this.Height);
}

protected override Size MeasureOverride(Size constraint)
{
this.circularGauge1.LayoutTransform = new ScaleTransform(constraint.Width / _oriSize.Width, constraint.Height / _oriSize.Height);
return base.MeasureOverride(constraint);
}

 

What we are doing here first we save the original size , whenever the user control get resize , user control will re measure with the new size . We calculate the ratio by doing a new size / old size , then appy a scale transformation to it .

 

Once it is done . You have a usercontrol that will resize the gauge .

Now , we need to use this gauge in a window .

We create a new project , then embed the newly created UserControl in the XAML


<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:lala="clr-namespace:Demo;assembly=Demo"
    Title="Window1" Height="200" Width="200">
    <Grid>
        <l:MyGauge></:MyGauge>
    </Grid>
</Window>



But when you run the project , as you resize the window , the control does not resize !!

The solution to this problemi is in XAML

change

 <l:MyGauge Width="Auto" Height="Auto"></l:MyGauge>
 

Now the window will resize the user control automatically .

 download the application from here 

 http://nextwavesoft.com/images/fbfiles/files/Demo-ae3449dbe05da0c8a1ca07654d969596.zip

 

 

 

 

 

 


  Auto Resizing | Gauge | XAML | Control | WPF
Comments 0Hits: 1653  


ieee.logo.jpg 

 K. Y. Sim, C. S. Low, F.-C. Kuo, "Automatic Testing of Financial Charting Software Component: A Case Study on Point and Figure Chart", Proceedings of 2009 International Conference on Computer Science and its Applications, IEEE Press, PUBLISHED. Read more...

K.Y. Sim, C.S. Low and F.-C. Kuo, "Detecting Faults in the Computation of Technical Indicators", The 2nd International Conference on Information Science and Engineering (ICISE 2010), IEEE Press, To Appear. 

Nextwave Suite for WPF, with Chart and Gauge, is compatible with:

Download Microsoft .net Framework 4.0

Microsoft Visual Studio 2010

Download Microsoft .net Framework 3.5

About Windows Presentation Foundation

 Visual Studio 2008

Expression Blend

About XAML

Calendar

< September 2010 >
Mo Tu We Th Fr Sa Su
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Latest Comments

Online Support

online support

Login

Polls

In future, what kind of release you are looking forward?