Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

New Post: [Version 2.0]Add documents from code

$
0
0
I can't get it. I've been breaking my head with the wall.

Let's make it someway simpler so I may can understand how this work.

I got a ViewModel something like:
Public Class DocumentViewModel
    Inherits BaseViewModel
    Implements IDisposable

    Private _name As String, _saved as Boolean

    Public Property Name As String
        Get
            Return If(Not _saved, String.Format("{0}*", _name), _name)
        End Get
        Set(value As String)
            If Not _name = value Then
                _name = value
                OnPropertyChanged("Name")
            End If
        End Set
    End Property

    Public Property Saved As Boolean
        Get
            Return _saved
        End Get
        Set(value As Boolean)
            _saved = value
        End Set
    End Property

End Class
Now I've in a module (for it to be accessed from the hole project without any problems)
Public Documents As New ObservableCollection(Of DocumentViewModel) 'This collection is for DocumentSource
Now I've a View with 1 textbox and one button. When the button is pressed, the title of the document panel change to whatever is the text of the textbox. How to update the new document panel title on the Documents Collection? I mean how I'm supposed to find the right one? Or I'm just doing a mess and I should do this in an other way?

Viewing all articles
Browse latest Browse all 2690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>