Hi,
it seem to be a block in my head.
I try to build my first MVC-application. Fields (Text etc.) on the gui shall change their values as some attributes of the classes of the model are changed.
When I bind one attribute so several textboxes on the screen and change the content of on textbox the other textboxes change their values as desired.
When I change the attribute for example by a button that calls a method changing the value of the attribute (property) nothing happens on the screen. My debugging shows that the same Event is risen when changing the property by both ways. Only the first way makes the textboxes respond.
Where could I find a hint to find a way to solve my problem
Thanks
Martin
See:
+++++ Property
PublicProperty Name() As String
Get
Return aName
EndGet
Set(ByVal value As String)
aName = value
OnPropertyChanged("Name")
EndSet
EndProperty
+++++ Event
ProtectedSub OnPropertyChanged(ByVal prop AsString)
RaiseEvent PropertyChanged(Me,New PropertyChangedEventArgs(prop))
EndSub
+++++ XAML
Grid DataContext="{StaticResource pers1}">
...
<Label Grid.Column="0" Grid.Row="0">Zuname:</Label>
<TextBox Grid.Column="1" Grid.Row="0" Name="txtZuname"
Text="{Binding Path=Name}"/>
...
it seem to be a block in my head.
I try to build my first MVC-application. Fields (Text etc.) on the gui shall change their values as some attributes of the classes of the model are changed.
When I bind one attribute so several textboxes on the screen and change the content of on textbox the other textboxes change their values as desired.
When I change the attribute for example by a button that calls a method changing the value of the attribute (property) nothing happens on the screen. My debugging shows that the same Event is risen when changing the property by both ways. Only the first way makes the textboxes respond.
Where could I find a hint to find a way to solve my problem
Thanks
Martin
See:
+++++ Property
PublicProperty Name() As String
Get
Return aName
EndGet
Set(ByVal value As String)
aName = value
OnPropertyChanged("Name")
EndSet
EndProperty
+++++ Event
ProtectedSub OnPropertyChanged(ByVal prop AsString)
RaiseEvent PropertyChanged(Me,New PropertyChangedEventArgs(prop))
EndSub
+++++ XAML
Grid DataContext="{StaticResource pers1}">
...
<Label Grid.Column="0" Grid.Row="0">Zuname:</Label>
<TextBox Grid.Column="1" Grid.Row="0" Name="txtZuname"
Text="{Binding Path=Name}"/>
...