Wpf Autocad API,数据绑定Inotifyproperty更改不起作用
几天来我一直在努力使它工作,但我做不到。。请帮忙 我的xaml 末级 我的Viewmodel类 公共类主视图模型 实现INotifyPropertyChangedWpf Autocad API,数据绑定Inotifyproperty更改不起作用,wpf,vb.net,data-binding,autocad,autocad-plugin,Wpf,Vb.net,Data Binding,Autocad,Autocad Plugin,几天来我一直在努力使它工作,但我做不到。。请帮忙 我的xaml 末级 我的Viewmodel类 公共类主视图模型 实现INotifyPropertyChanged Public Property device As String Get Return _device End Get Set(value As String) _device = value OnPropertyChange("device") End
Public Property device As String
Get
Return _device
End Get
Set(value As String)
_device = value
OnPropertyChange("device")
End Set
End Property
Private _device As String
Protected Sub OnPropertyChange(name As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(name))
End Sub
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
末级
命令类
公共类命令
公共子面板()
Dim addpn作为新的PNWPFPALETE
Dim viewmodel作为新的主viewmodel
addpn.showpnwpfpalete()
Dim DL As String=addpn.findattributes()
viewmodel.device=DL
端接头
末级
运行命令后文本框仍为空。。。请帮忙……我在你的重复帖子中回复你:@gileCAD,谢谢你,但是你能告诉我需要编辑什么吗?我需要从Xaml中删除代码吗?
Public devicelocaton As String
Shared _PS1 As PaletteSet = Nothing
Public Sub ShowPNWPFPalette()
If _PS1 Is Nothing Then
_PS1 = New PaletteSet("Modify Attributes")
_PS1.Size = New Size(400, 600)
_PS1.DockEnabled = DirectCast(CInt(DockSides.Left) + CInt(DockSides.Right), DockSides)
Dim uc1 As New PN_NO
'_PS1.AddVisual("Update PN", uc1)
Dim host As ElementHost = New ElementHost
host.AutoSize = True
host.Dock = DockStyle.Fill
host.Child = uc1
_PS1.Add("Modify PN", host)
Dim uc2 As New PN_NO
Dim host1 As ElementHost = New ElementHost
host1.AutoSize = True
host1.Dock = DockStyle.Fill
host1.Child = uc2
_PS1.Add("Modify PN2", host1)
End If
_PS1.KeepFocus = True
_PS1.Visible = True
End Sub
Public Function findattributes()
Dim DL As String= "Pankaj"
Return DL
End Function
Public Property device As String
Get
Return _device
End Get
Set(value As String)
_device = value
OnPropertyChange("device")
End Set
End Property
Private _device As String
Protected Sub OnPropertyChange(name As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(name))
End Sub
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged