Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF VB.NET
i am trying wpf for the first time and with lot of research and help from Pete O'Hanlon. i was able to come to a certain point. but after binding with the class and all i am still not able to get the value to the label when it changes in the code of class
 
I am using VS2008 framework 3.5
 
<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Avenet Prduct Description Extractor" Height="396.627" Width="588.123" removed="AliceBlue" >
    <Grid Height="341.077" Width="567.721" removed="AliceBlue">
 
        
        <StackPanel Margin="170.225,226.418,3.143,0" Name="StackPanel1" Height="97.994" VerticalAlignment="Top">
            <Label Height="30.906" Name="lblCrntSt1" Content="{Binding PrdFrstName}" Width="161" BorderThickness="2" BorderBrush="AliceBlue" Background="Red" Foreground="White" FontSize="13"></Label>
            <Label Height="33.633" Name="lblcrntst2" Content="{Binding prdScndName}" Width="161" BorderThickness="2" BorderBrush="AliceBlue" Background="Red" Foreground="White" FontSize="13"></Label>
            <Label Height="29.997" Name="lblcrntst3" Content="{Binding prdLastName}" Width="161" BorderThickness="2" BorderBrush="AliceBlue" Background="Red" Foreground="White" FontSize="13">Label State3</Label>
        </StackPanel>
        <StackPanel Margin="0,62.216,73.348,0" Name="StackPanel2" Height="94.816" VerticalAlignment="Top" removed="Honeydew" HorizontalAlignment="Right" Width="144.43">
            <StackPanel.Resources>
                <Style TargetType="Button">
                    <Setter Property="Margin" Value="0,07,0,0"></Setter>
 
                </Style>
 
            </StackPanel.Resources>
            
        
    </Grid>
</Window>
 
 

here is the window class where it is initialized
 
Class Window1
 
    Dim clsIniti As New ExtractDetails
 
Public Sub New()
 
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        'clsIniti = New ExtractDetails
        Me.DataContext = clsIniti
 
        ' Add any initialization after the InitializeComponent() call.

    End Sub
end class
 

 
here is my class where it all happens. this is a separate class
 
Public Class ExtractDetails
    Inherits UserControl
    Implements System.ComponentModel.INotifyPropertyChanged
 
    Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
    
    Private _prdFrstName, _prdScndName, _prdLastName As String
    Private lstPdfDwn As List(Of String) = New List(Of String)
    Dim intPgeLop As Integer = 0
    Dim blnPgeLod As Boolean
 

#Region "Properties for Passing back the values to form"
 
    Public Property PrdFrstName() As String
        Get
            Return _prdFrstName
        End Get
        Set(ByVal value As String)
            If _prdFrstName <> value Then
                _prdFrstName = value
                OnPropertyChanged("PrdFrstName")
            End If
        End Set
    End Property
 

 
    Public Property prdScndName() As String
        Get
            Return _prdScndName
        End Get
        Set(ByVal value As String)
            If _prdScndName <> value Then
                _prdScndName = value
                OnPropertyChanged("prdScndName")
            End If
        End Set
    End Property
 
    Public Property prdLastName() As String
        Get
            Return _prdLastName
        End Get
        Set(ByVal value As String)
            If _prdLastName <> value Then
                _prdLastName = value
                OnPropertyChanged("prdLastName")
            End If
        End Set
    End Property
 
	Private Sub OnPropertyChanged(ByVal propertyName As String)
        	RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
    	End Sub
 
#End Region
 

 Public Sub suMainStrt(ByVal strFilePath As String)
		PrdFrstName= "http://www.lg.com"
 
                Call extract(webBrwFrst, strComurl(1))
                webBrwFrst.Dispose()
                webBrwFrst = Nothing
end sub
 
End Class
 

I m getting confused. please correct me. i am totally new to this WPF and MVVM
the extract function is working and i am getting all the details and every thing
i created this in windows forms and it is working great.
 
this is edited coed and i might have missed adding something. but i am not getting any errors as of such in my VS2008
Posted 22-Feb-13 1:33am
Edited 22-Feb-13 1:35am
v2
Comments
Manu_vish at 25-Feb-13 0:42am
   
i am doing all correct or nothing correct??? i tried all googled things. but nothing is making it reflect that change in url. does any one have any idea

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

i did a silly mistake of creating that class objects twice and accessing object with no values in the properties. big blunder.
so created only one instance and it is working like charm.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 320
1 OriginalGriff 275
2 Sergey Alexandrovich Kryukov 187
3 Afzaal Ahmad Zeeshan 154
4 Peter Leow 115
0 OriginalGriff 7,510
1 DamithSL 5,494
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100