Imports DevExpress.Xpf.Docking

Public Class ucPDFViewer
    Public Sub New(st As IO.Stream)

        ' Esta llamada es exigida por el diseñador.
        InitializeComponent()
        If st IsNot Nothing Then Me.VisorPDF.DocumentSource = st
        ' Agregue cualquier inicialización después de la llamada a InitializeComponent().

    End Sub

    Public Sub New(st As IO.Stream, grd As DocumentGroup, id As String)

        ' Esta llamada es exigida por el diseñador.
        InitializeComponent()
        If st IsNot Nothing Then Me.VisorPDF.DocumentSource = st
        Dim cmdp = Me.VisorPDF.CommandProvider


        Dim dc = Comun.dm.DockController

        Dim docpanel As DevExpress.Xpf.Docking.DocumentPanel
        Dim d = (From p In grd.Items Where p.Tag = id)
        If d.Count > 0 Then
            docpanel = d.First
        Else
            docpanel = New DevExpress.Xpf.Docking.DocumentPanel
            docpanel.Caption = id
            docpanel.Content = Me
            docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
            docpanel.Tag = id
            grd.Items.Add(docpanel)
        End If
        dc.Activate(docpanel)




    End Sub


End Class
