Click here to Skip to main content
14,544,361 members

Silverlight / WPF

 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 8:23
professionalKevin Marois13-Jan-17 8:23 
GeneralRe: Bind To Static Property Pin
Richard Deeming13-Jan-17 8:24
mveRichard Deeming13-Jan-17 8:24 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 8:25
professionalKevin Marois13-Jan-17 8:25 
GeneralRe: Bind To Static Property Pin
Richard Deeming13-Jan-17 8:29
mveRichard Deeming13-Jan-17 8:29 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 8:31
professionalKevin Marois13-Jan-17 8:31 
QuestionWPF/MVVM - How To Make A Chess Board Pin
Kevin Marois20-Dec-16 6:13
professionalKevin Marois20-Dec-16 6:13 
AnswerRe: WPF/MVVM - How To Make A Chess Board Pin
Meshack Musundi26-Dec-16 19:26
professionalMeshack Musundi26-Dec-16 19:26 
QuestionMetroTabItem View Going out of Scope Pin
JPKI13-Dec-16 12:59
MemberJPKI13-Dec-16 12:59 
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. ObservableCollection<RdpClient>RemoteClients{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

<Grid>
	<controls:MetroTabControl VerticalAlignment="Stretch" HorizontalAlignment="Stretch"

							  IsSynchronizedWithCurrentItem="True"

							  ItemsSource="{Binding RemoteClients, UpdateSourceTrigger=PropertyChanged}"

							  SelectedItem="{Binding SelectedRemoteClient, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

							  CloseTabCommand="{Binding CloseTabCommand}" >
		
		<controls:MetroTabControl.Resources>
			<DataTemplate x:Key="contentTemplate" x:Shared="False">
				<local:RemoteDesktopBaseControlView />
			</DataTemplate>
		</controls:MetroTabControl.Resources>
		
		<controls:MetroTabControl.ItemContainerStyle>
			<Style TargetType="{x:Type controls:MetroTabItem}">
				<Setter Property="Header" Value="{Binding ViewTitle, UpdateSourceTrigger=PropertyChanged}" />
				<Setter Property="controls:MetroTabItem.ContentTemplate" Value="{StaticResource contentTemplate}"/>
				<Setter Property="controls:MetroTabItem.CloseButtonEnabled" Value="True"/>
				<Setter Property="controls:MetroTabItem.CloseTabCommandParameter" Value="{Binding}" />
				<Setter Property="controls:ControlsHelper.HeaderFontSize" Value="16" />
				<Setter Property="controls:ControlsHelper.HeaderMargin" Value="4" />
			</Style>
		</controls:MetroTabControl.ItemContainerStyle>
	</controls:MetroTabControl>
</Grid>


Any Ideas how to fix this?
AnswerRe: MetroTabItem View Going out of Scope Pin
Pete O'Hanlon13-Dec-16 20:50
subeditorPete O'Hanlon13-Dec-16 20:50 
GeneralRe: MetroTabItem View Going out of Scope Pin
JPKI13-Dec-16 22:14
MemberJPKI13-Dec-16 22:14 
GeneralRe: MetroTabItem View Going out of Scope Pin
JPKI15-Dec-16 8:33
MemberJPKI15-Dec-16 8:33 
QuestionUserControl Pin
Kevin Marois5-Dec-16 11:02
professionalKevin Marois5-Dec-16 11:02 
AnswerRe: UserControl Pin
Jon McKee5-Dec-16 11:12
professionalJon McKee5-Dec-16 11:12 
GeneralRe: UserControl Pin
Kevin Marois5-Dec-16 11:22
professionalKevin Marois5-Dec-16 11:22 
GeneralRe: UserControl Pin
Jon McKee5-Dec-16 11:40
professionalJon McKee5-Dec-16 11:40 
GeneralRe: UserControl Pin
Kevin Marois5-Dec-16 11:46
professionalKevin Marois5-Dec-16 11:46 
GeneralRe: UserControl Pin
Jon McKee5-Dec-16 11:56
professionalJon McKee5-Dec-16 11:56 
AnswerRe: UserControl Pin
Gerry Schmitz5-Dec-16 11:29
mveGerry Schmitz5-Dec-16 11:29 
GeneralRe: UserControl Pin
Meshack Musundi5-Dec-16 22:23
professionalMeshack Musundi5-Dec-16 22:23 
GeneralRe: UserControl Pin
Kevin Marois6-Dec-16 4:49
professionalKevin Marois6-Dec-16 4:49 
GeneralRe: UserControl Pin
Meshack Musundi6-Dec-16 5:04
professionalMeshack Musundi6-Dec-16 5:04 
AnswerRe: UserControl Pin
Richard Deeming6-Dec-16 2:10
mveRichard Deeming6-Dec-16 2:10 
GeneralRe: UserControl Pin
Kevin Marois6-Dec-16 4:47
professionalKevin Marois6-Dec-16 4:47 
QuestionC# WPF listbox binding to selected item does not update my property Pin
Member 128805954-Dec-16 5:54
MemberMember 128805954-Dec-16 5:54 
AnswerRe: C# WPF listbox binding to selected item does not update my property Pin
Richard Deeming5-Dec-16 1:58
mveRichard Deeming5-Dec-16 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.