Click here to Skip to main content
15,913,685 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Linux Hosting Pin
Mycroft Holmes6-Mar-12 0:10
professionalMycroft Holmes6-Mar-12 0:10 
GeneralRe: Linux Hosting Pin
Pete O'Hanlon6-Mar-12 0:43
mvePete O'Hanlon6-Mar-12 0:43 
QuestionDrag-and-Drop out of Silverlight 5 application Pin
roni-in4-Mar-12 21:50
roni-in4-Mar-12 21:50 
AnswerRe: Drag-and-Drop out of Silverlight 5 application Pin
Abhinav S4-Mar-12 22:04
Abhinav S4-Mar-12 22:04 
GeneralRe: Drag-and-Drop out of Silverlight 5 application Pin
roni-in4-Mar-12 22:14
roni-in4-Mar-12 22:14 
GeneralRe: Drag-and-Drop out of Silverlight 5 application Pin
Mycroft Holmes5-Mar-12 21:35
professionalMycroft Holmes5-Mar-12 21:35 
Questionpicbox Pin
MemberDotNetting4-Mar-12 12:43
MemberDotNetting4-Mar-12 12:43 
Questionintegrate solution Pin
MemberDotNetting4-Mar-12 12:17
MemberDotNetting4-Mar-12 12:17 
AnswerRe: integrate solution Pin
Richard Andrew x644-Mar-12 13:31
professionalRichard Andrew x644-Mar-12 13:31 
AnswerRe: integrate solution Pin
Pete O'Hanlon4-Mar-12 20:35
mvePete O'Hanlon4-Mar-12 20:35 
AnswerRe: integrate solution Pin
Abhinav S4-Mar-12 21:10
Abhinav S4-Mar-12 21:10 
QuestionWPF Calendar (C#) Pin
Cazaceanu Andrei4-Mar-12 7:22
Cazaceanu Andrei4-Mar-12 7:22 
Questionlooking for binding properties dynamicly in wpf Pin
Aymane Farissi4-Mar-12 5:01
Aymane Farissi4-Mar-12 5:01 
AnswerRe: looking for binding properties dynamicly in wpf Pin
Pete O'Hanlon6-Mar-12 22:01
mvePete O'Hanlon6-Mar-12 22:01 
QuestionHoe to find Listbox index from point ? (WPF) Pin
falukky3-Mar-12 10:15
falukky3-Mar-12 10:15 
AnswerRe: Hoe to find Listbox index from point ? (WPF) Pin
Abhinav S4-Mar-12 21:12
Abhinav S4-Mar-12 21:12 
Questionhow to right click on item from Listbox and open menu on WPF Pin
gshhar3-Mar-12 8:34
gshhar3-Mar-12 8:34 
Questionhtml editor Pin
MemberDotNetting2-Mar-12 12:04
MemberDotNetting2-Mar-12 12:04 
AnswerRe: html editor Pin
Pete O'Hanlon2-Mar-12 21:31
mvePete O'Hanlon2-Mar-12 21:31 
AnswerRe: html editor Pin
Abhinav S2-Mar-12 23:10
Abhinav S2-Mar-12 23:10 
QuestionGalaSoft and Events Pin
Kevin Marois2-Mar-12 6:15
professionalKevin Marois2-Mar-12 6:15 
AnswerRe: GalaSoft and Events Pin
SledgeHammer012-Mar-12 6:33
SledgeHammer012-Mar-12 6:33 
GeneralRe: GalaSoft and Events Pin
Kevin Marois2-Mar-12 6:57
professionalKevin Marois2-Mar-12 6:57 
GeneralRe: GalaSoft and Events Pin
SledgeHammer012-Mar-12 7:41
SledgeHammer012-Mar-12 7:41 
LOL, you were the one who asked the question Smile | :) . Anyways, you need to attach the interaction triggers to a Visual, so you need to include the control template unfortunately. The interaction triggers are buried a few lines down Smile | :) . This does seem a little messy. Your other option is to have a reusable control that forwards the ListBoxItem event to the parent ListBox. That's what I do in my framework, but its a bit more work. One other simpler option might be to just trap the ListBox double click and chase up the visual tree to make sure you clicked on a ListBoxItem.

C#
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
	<Setter Property="Template">
		<Setter.Value>
			<ControlTemplate TargetType="{x:Type ListBoxItem}">
				<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
					<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
					<i:Interaction.Triggers>
                                            <!-- INSERT HERE -->
					</i:Interaction.Triggers>
				</Border>
				<ControlTemplate.Triggers>
					<Trigger Property="IsSelected" Value="true">
						<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
						<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
					</Trigger>
					<MultiTrigger>
						<MultiTrigger.Conditions>
							<Condition Property="IsSelected" Value="true"/>
							<Condition Property="Selector.IsSelectionActive" Value="false"/>
						</MultiTrigger.Conditions>
						<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
					</MultiTrigger>
					<Trigger Property="IsEnabled" Value="false">
						<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
					</Trigger>
				</ControlTemplate.Triggers>
			</ControlTemplate>
		</Setter.Value>
	</Setter>
</Style>

QuestionAdd a new Module for a Prism application (WPF) Pin
radhwane2-Mar-12 6:12
radhwane2-Mar-12 6:12 

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.