I have a MetroTabControl that I want to use to display several RDP connections using the TabItems, the problem that I`m having is, after I establish the first RDP connection, If I switch tabItem, the view goes out of scope and I loose the connection in that TabItem (so each time I switch tabitem the view goes out of scope). I wanted to maintain the connection alive in each TabItem and control the close of the view with the CloseTabCommand using the tabitem CloseButton.
In this sample the RemoteClients is an Observable collection of an objectClass that each TabItem will bind to
e.g. ObservableCollectionRemoteClients{get; set;}
The SelectedRemoteClient represents the current selected object (RdpClient).
RemoteDesktopBaseControlView is the view that each TabItem will have and has all the bindings for the RdpClient object
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding RemoteClients, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SelectedRemoteClient, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
CloseTabCommand="{Binding CloseTabCommand}" >
Any Ideas how to fix this?
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
24 HDreamsPosted Dec 15, 2016, 2:33 PM