In the previous step you created a new Silverlight project and added Gauges for Silverlight controls to the application. In this step you'll add code to your application to customize it.
Complete the following steps:
Visual Basic |
Copy Code
|
---|---|
Imports C1.Silverlight Imports C1.Silverlight.Gauge |
C# |
Copy Code
|
---|---|
using C1.Silverlight; using C1.Silverlight.Gauge; |
Example Title |
Copy Code
|
---|---|
Private Sub tb1_TextChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.TextChangedEventArgs) Handles tb1.TextChanged Me.c1lg1.Value = Me.tb1.Text Me.c1rg1.Value = Me.tb1.Text Me.c1kb1.Value = Me.tb1.Text End Sub |
C# |
Copy Code
|
---|---|
private void tb1_TextChanged(object sender, TextChangedEventArgs e) { this.c1lg1.Value = Convert.ToDouble(this.tb1.Text); this.c1rg1.Value = Convert.ToDouble(this.tb1.Text); this.c1kb1.Value = Convert.ToDouble(this.tb1.Text); } |
When a number is entered in the text box at run time, the value of the gauge controls will be set to that number.
Visual Basic |
Copy Code
|
---|---|
Private Sub c1kb1_ValueChanged(ByVal sender As System.Object, ByVal e As C1.Silverlight.PropertyChangedEventArgs(Of System.Double)) Handles c1kb1.ValueChanged Me.c1lg1.Value = Me.c1kb1.Value Me.c1rg1.Value = Me.c1kb1.Value Me.tb1.Text = Me.c1kb1.Value.ToString End Sub |
C# |
Copy Code
|
---|---|
private void c1kb_ValueChanged(object sender, PropertyChangedEventArgs<double> e) { this.c1lg1.Value = this.c1kb1.Value; this.c1rg1.Value = this.c1kb1.Value; this.tb1.Text = Convert.ToString(this.c1kb1.Value); } |
In this step you completed adding code to your application. In the next step you'll run the application and observe run-time interactions.