|
Your english is quite poor or i do not understand what you want to ask.
You said First Hyperling, do you mean it will fire event when you click firt hyperling on list, or does it fire once where you click any hyperlings on list?
I think it is a second. As again, How do you asign Click event? Your answer was not good enough. I am C# developer.
are you using System.Windows.Documents.HyperLink from PresentationFramework.dll? if so do you aware that each hyperling has its own click event?
|
|
|
|
|
second you think is right.
and.. I'm not using PresentationFramework.dll
(I'm not one English-speaking countries. So I do not speak English very well. Sorry)
|
|
|
|
|
there is a possiblity you need to move event decleration (xaml) on a logic list or force a focus to element
|
|
|
|
|
What does that mean?
Some do not understand.
|
|
|
|
|
Can you paste a XAML sample, where it contains grdList and event hyperLink_Click. Not a code
For setting focus, you can use:
grdList.SetFocus();
This example is in C#. Veary easy to convert to VB.NET. But i do not know Syntax for vb.net
|
|
|
|
|
Ah! I've solved this problem.
Thank You!
|
|
|
|
|
How can I tell whether a Silverlight Textbox vertical scrollbar is visible or not?
When the text is short the scrollbar is hidden. When the text is long it's shown. Is there a means to check if the vertical scrollbar is visible?
Thanks in advance,
marcelo
|
|
|
|
|
Try putting this code in the textBox.Loaded event handler:
ScrollBar verticalScrollBar = ((FrameworkElement)VisualTreeHelper.GetChild(viewer, 0)).FindName("VerticalScrollBar") as ScrollBar;
verticalScrollBar.ValueChanged += (s, ev) => button.Visibility = System.Windows.Visibility.Collapsed;
I got his code from here (google is your friend, btw):
http://www.c-sharpcorner.com/Blogs/BlogDetail.aspx?BlogId=3703[^]
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thank you very much, John
|
|
|
|
|
For ListBoxes it's as easy as this:
lbRecipients.GetScrollHost().ComputedVerticalScrollBarVisibility
|
|
|
|
|
hi,
i am using visual studio 10 professional for my silverlight project
first of all - i mannaged to show my webcam output on a rectangle located on the webpage. (yeepee for me
the problem is - when i run the app with my visual studio debugger and its time for the webcam to ask for access appoval i get a window saying:
"protection error
Dubgger detected - please close it down and restart!"
i assume there is some protection on my machine that protects it from running my webcam stream from a running debugger (vs 10 in this matter)
is there a way to go around it ? i hate to be able to run my code only at the website.
tnx in advance
|
|
|
|
|
Do you have Nero installed at all? It seems there's a problem with Nero's DirectShow filter which causes this error.
|
|
|
|
|
you mean Nero the disc burner?
i got it , its not running thow.
what do you think i should do ?
shall i 'burn' it?
|
|
|
|
|
shabya wrote: you mean Nero the disc burner?
Yes.
shabya wrote: i got it , its not running thow.
It doesn't need to be. There have been lots of reports of Nero causing this problem.
shabya wrote: what do you think i should do ?
Try uninstalling it.
|
|
|
|
|
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.
|
|
|
|
|
Move the Storyboard into the DataTemplate.Resources rather than out in a separate section. Basically, you are running into namescope issues here and moving the storyboard inside the same template should help.
|
|
|
|
|
Hi Experts,
I have a user control which is having a listview inside it. The SelectionChanged event of this list view is handled inside the user control. The code for the same is as follows:
private void lstvMyView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{...}
I want to call this handler again from some other place inside the user control. So to call this handler i need the "SelectionChangedEventArgs" there. When I am trying to create the instance of "SelectionChangedEventArgs", i am unable to understand what should I pass as parameters to the constructor of "SelectionChangedEventArgs".
The place from where I am suppose to call this handler does not add or remove any items in the listview. It just navigates in the items in the listview thereby changing the selectedindex of the listview.
I am trying to do something like this. The below code is obviously incorrect.
lstvMyView_SelectionChanged(_lstvMyView, new SelectionChangedEventArgs());
Please Help!
Thanks in Advance!
Regards,
Samar
modified on Wednesday, September 29, 2010 4:42 AM
|
|
|
|
|
Just because there's a SelectionChangedEventArgs parameter there, it doesn't mean you have to pass anything to it. If you don't actually do anything in the method with the value e , you can simply pass null in as the parameter.
lstMyView_SelectionChanged(lstMyView, null); Similarly, if you don't do anything with sender, you can always pass null in there.
A simpler technique would be to move the functionality that lstMyView_SelectionChanged implements out into a separate method and call that directly (and from the event handler as well).
Now that we've covered that, I would urge you to look into MVVM to stop relying on the code behind here. If your method is updating a model in some way, you really should separate it out of the view specific code (obviously, if you are just triggering an animation or other view option then what you are doing here is perfectly fine and shouldn't be refactored outside the view).
|
|
|
|
|
hi Pete,
I cannot pass null to the parameter because i am doing something with e in inside the handler. Sorry to have not mentioned it here.
Regards,
Samar
|
|
|
|
|
Really, you shouldn't be calling the event handler directly - you should use a method that accepts the arguments you are interested in and call that from your event handler. Here[^] is more information on what the constructor takes; as a hint, a question like this could be easily answered for you by looking up the documentation in MSDN.
|
|
|
|
|
Hi Pete,
The link you have provided gives just a general information on "SelectionChangedEventArgs" class. Also even if I create a method as you have told still i would need to initialize the class somewhere in the said method, right? Or maybe i am not able to understand what you are trying to say. Can you please give me a small code snippet of the functionality you mentioned? Thanks for your valuable time here.
Regards,
Samar
|
|
|
|
|
You don't need to initialize the class in the method - all you need to do is have a method that accepts the relevant IList(s) that you are interested in, and work with it there. For instance:
private void MyMethod(IList addedItems, IList removedItems)
{
} Then all you need do in your event handler is call
MyMethod(addedItems, removedItems);
|
|
|
|
|
Hi Pete thanks for your answer. This looks good. Just 1 question. Say I have a listview with 5 items in it and that the 2nd item is selected then "addedItems" is the 2nd item and "removedItems" are the rest of the 4 items. Am I right on this part?
Regards,
Samar
|
|
|
|
|
Not quite. AddedItems refers to the items that were added to the selection since the last time the event was fired, and RemovedItems refers to the items that were removed from the selection since the last time the event was fired. This means that the changes effectively represent deltas and are cumulative.
|
|
|
|
|
Hi friends,
I have made a small application using WPF. Now I want to obfuscate so that no one can steal my algorithms. Also so that no one can break my licensing mechanism.
I did try trial/free versions of some tools like Dotfuscator, Eazfuscator, Babel etc. But in these trial versions, my application get crashed while executing its one or other functionality. It might be because vendor don't want us to use application obfuscated with their free/trial versions.
Can anybody suggest me a free Obfuscator which provide reasonable/moderate security but no crash or serious bugs in obfuscated assemblies?
Thanks in Advance
Aseem
|
|
|
|