In the previous steps you set up the application's user interface and added controls to your application. In this step you'll add code to your application to finalize it.
Complete the following steps:
Visual Basic Copy Code Imports C1.WPF
C# Copy Codeusing C1.WPF;
Visual Basic Copy Code Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded UpdateGradient() End Sub
C# Copy Code private void Window_Loaded(object sender, RoutedEventArgs e) { UpdateGradient(); }
Visual Basic Copy Code Private Sub UpdateGradient() If IsLoaded Then Me.goldcol.Offset = Me.c1rs1.LowerValue Me.blackcol.Offset = Me.c1rs1.UpperValue End If End Sub
C# Copy Code UpdateGradient() { if (IsLoaded) { this.goldcol.Offset = this.c1rs1.LowerValue; this.blackcol.Offset = this.c1rs1.UpperValue; } }
Visual Basic Copy Code Private Sub c1rs1_LowerValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles c1rs1.LowerValueChanged UpdateGradient() End Sub
C# Copy Code private void c1rs1_LowerValueChanged(object sender, EventArgs e) { UpdateGradient(); }
Visual Basic Copy Code Private Sub c1rs1_UpperValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles c1rs1.UpperValueChanged UpdateGradient() End Sub
C# Copy Codec1rs1_UpperValueChanged(object sender, EventArgs e) { UpdateGradient(); }
In this step you completed adding code to your application. In the next step you'll run the application and observe run-time interactions.
Visual Basic Copy Code Imports C1.Silverlight
C# Copy Codeusing C1.Silverlight;
Visual Basic Copy Code Private Sub UpdateGradient() If c1rs1 IsNot Nothing Then Me.goldcol.Offset = Me.c1rs1.LowerValue Me.blackcol.Offset = Me.c1rs1.UpperValue End If End Sub
C# Copy Code UpdateGradient() { if (c1rs1 != null) { this.goldcol.Offset = this.c1rs1.LowerValue; this.blackcol.Offset = this.c1rs1.UpperValue; } }
Visual Basic Copy Code Private Sub c1rs1_LowerValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles c1rs1.LowerValueChanged UpdateGradient() End Sub
C# Copy Code private void c1rs1_LowerValueChanged(object sender, EventArgs e) { UpdateGradient(); }
Visual Basic Copy Code Private Sub c1rs1_UpperValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles c1rs1.UpperValueChanged UpdateGradient() End Sub
C# Copy Codec1rs1_UpperValueChanged(object sender, EventArgs e) { UpdateGradient(); }
In this step you completed adding code to your application. In the next step you'll run the application and observe run-time interactions.