Click here to Skip to main content
15,890,512 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How can I tell whether a Silverlight Textbox vertical scrollbar is visible or not Pin
#realJSOP1-Oct-10 8:25
mve#realJSOP1-Oct-10 8:25 
GeneralRe: How can I tell whether a Silverlight Textbox vertical scrollbar is visible or not Pin
Marcelo Ricardo de Oliveira4-Oct-10 3:18
Marcelo Ricardo de Oliveira4-Oct-10 3:18 
GeneralRe: How can I tell whether a Silverlight Textbox vertical scrollbar is visible or not Pin
Damien Dunphy31-May-11 22:34
Damien Dunphy31-May-11 22:34 
Questionusing webcam with silverlight 4 - protection error Pin
shabya30-Sep-10 2:19
shabya30-Sep-10 2:19 
AnswerRe: using webcam with silverlight 4 - protection error Pin
Pete O'Hanlon30-Sep-10 2:26
mvePete O'Hanlon30-Sep-10 2:26 
GeneralRe: using webcam with silverlight 4 - protection error Pin
shabya30-Sep-10 2:29
shabya30-Sep-10 2:29 
GeneralRe: using webcam with silverlight 4 - protection error Pin
Pete O'Hanlon30-Sep-10 2:43
mvePete O'Hanlon30-Sep-10 2:43 
QuestionHow to begin storyboard based on ListBoxItem selection??? Pin
vladc7730-Sep-10 1:09
vladc7730-Sep-10 1:09 
I encounter a problem that I cannot solve. I hope to find an answer here. I need a listbox to hide half way when a certain listboxitem is selected. I setup a storyboard with opacity mask animation which work fine in blend. My problem I cannot initiate BeginStoryboard. I tried numerous ways and no success. I need to hide the listbox to reveal the content behind it. I generate listboxitems from XML data file and based on the name node I planned to initiate storyboard playing.

Here what I have. I created DataTemplate which I set via Setter in ListBoxItem Style:

<DataTemplate x:Key="SelectedListBoxItemDataTemplate">
			<StackPanel x:Name="DataItemSelected" Orientation="Horizontal" Margin="12,0,0,0" >
					<TextBlock FontFamily="Arial" Text="►" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding XPath=state}" Margin="-4, 0,6,4"/>
					<Image x:Name="ListBoxImage" Source="{Binding XPath=icon}" Margin="4,4,14,4" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform" />
					<TextBlock x:Name="textBlock" Text="{Binding XPath=name}" FontFamily="Segoe UI Light" LineHeight="22" Foreground="#FFFFFFFF" FontSize="16"  />	
					<Border x:Name="PART_Icon" Background="{x:Null}" Width="{Binding NodeValue.Width}" HorizontalAlignment="Left" Padding="3,0"></Border>
				</StackPanel>
				
			<DataTemplate.Triggers>
				<DataTrigger Binding="{Binding XPath=name}" Value="SERVERS">
					<Setter TargetName="PART_Icon" Property="Background" Value="Black" />
					<DataTrigger.EnterActions>
						<BeginStoryboard Storyboard="{StaticResource HideListBox}" x:Name="HideListBox_BeginStoryboard"/>
					</DataTrigger.EnterActions>  
				</DataTrigger>
			</DataTemplate.Triggers>
		</DataTemplate>	


I need to run this storyboard which I keep in Window.Resources:

<Storyboard x:Key="HideListBox">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.OpacityMask).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="Nav_ListBox">
				<EasingDoubleKeyFrame KeyTime="0" Value="0.069"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.OpacityMask).(GradientBrush.GradientStops)[1].(GradientStop.Offset)" Storyboard.TargetName="Nav_ListBox">
				<EasingDoubleKeyFrame KeyTime="0" Value="0.069"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.OpacityMask).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="Nav_ListBox">
				<EasingColorKeyFrame KeyTime="0" Value="White"/>
				<EasingColorKeyFrame KeyTime="0:0:0.4" Value="White"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.OpacityMask).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="Nav_ListBox">
				<EasingColorKeyFrame KeyTime="0" Value="#00000000"/>
				<EasingColorKeyFrame KeyTime="0:0:0.4" Value="#00000000"/>
			</ColorAnimationUsingKeyFrames>
			<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="Nav_ListBox">
				<EasingPointKeyFrame KeyTime="0" Value="1.076,0.501"/>
				<EasingPointKeyFrame KeyTime="0:0:0.4" Value="1,0.5"/>
			</PointAnimationUsingKeyFrames>
			<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="Nav_ListBox">
				<EasingPointKeyFrame KeyTime="0" Value="0.035,0.501"/>
				<EasingPointKeyFrame KeyTime="0:0:0.4" Value="0.2,0.5"/>
			</PointAnimationUsingKeyFrames>
		</Storyboard>


I am getting errors that "Nav_ListBox" object cannot be found. I understand that listbox object is not avaible from the datatemplate level. I am wondering what will be the right solution to enable animation to play and eventualy to remove on click the othe listboxitem. Thank you in advance.
AnswerRe: How to begin storyboard based on ListBoxItem selection??? Pin
Pete O'Hanlon30-Sep-10 1:31
mvePete O'Hanlon30-Sep-10 1:31 
QuestionCreating an instance of SelectionChangedEventArgs in wpf Pin
dashingsidds28-Sep-10 22:31
dashingsidds28-Sep-10 22:31 
AnswerRe: Creating an instance of SelectionChangedEventArgs in wpf Pin
Pete O'Hanlon28-Sep-10 22:55
mvePete O'Hanlon28-Sep-10 22:55 
GeneralRe: Creating an instance of SelectionChangedEventArgs in wpf Pin
dashingsidds28-Sep-10 23:01
dashingsidds28-Sep-10 23:01 
GeneralRe: Creating an instance of SelectionChangedEventArgs in wpf Pin
Pete O'Hanlon28-Sep-10 23:24
mvePete O'Hanlon28-Sep-10 23:24 
GeneralRe: Creating an instance of SelectionChangedEventArgs in wpf Pin
dashingsidds28-Sep-10 23:43
dashingsidds28-Sep-10 23:43 
GeneralRe: Creating an instance of SelectionChangedEventArgs in wpf Pin
Pete O'Hanlon29-Sep-10 0:58
mvePete O'Hanlon29-Sep-10 0:58 
GeneralRe: Creating an instance of SelectionChangedEventArgs in wpf Pin
dashingsidds29-Sep-10 1:24
dashingsidds29-Sep-10 1:24 
GeneralRe: Creating an instance of SelectionChangedEventArgs in wpf Pin
Pete O'Hanlon29-Sep-10 1:30
mvePete O'Hanlon29-Sep-10 1:30 
QuestionWhich obfuscator can I use? Pin
Aseem Sharma28-Sep-10 8:06
Aseem Sharma28-Sep-10 8:06 
AnswerRe: Which obfuscator can I use? Pin
Pascal Hubert28-Sep-10 8:28
Pascal Hubert28-Sep-10 8:28 
GeneralRe: Which obfuscator can I use? Pin
Aseem Sharma28-Sep-10 17:51
Aseem Sharma28-Sep-10 17:51 
GeneralRe: Which obfuscator can I use? Pin
Aseem Sharma30-Sep-10 20:19
Aseem Sharma30-Sep-10 20:19 
AnswerRe: Which obfuscator can I use? Pin
Pete O'Hanlon28-Sep-10 9:00
mvePete O'Hanlon28-Sep-10 9:00 
GeneralRe: Which obfuscator can I use? Pin
Aseem Sharma28-Sep-10 17:50
Aseem Sharma28-Sep-10 17:50 
GeneralRe: Which obfuscator can I use? Pin
Pete O'Hanlon28-Sep-10 21:47
mvePete O'Hanlon28-Sep-10 21:47 
GeneralRe: Which obfuscator can I use? Pin
Aseem Sharma30-Sep-10 20:20
Aseem Sharma30-Sep-10 20:20 

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.