|
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
|
|
|
|
|
Hi,
A free one : NET NamesObfuscator
Take a look over there : http://pipiscrew.com/ in 'Freewares 4 developers' section.
Best regards.
neojudgment
|
|
|
|
|
Hi Neojudgment,
Thanks for the reply. Today I'll try to use NET NamesObfuscator and will get back to you with my findings. Hope it will work for me.
Best Regards
Aseem
|
|
|
|
|
Hi Friend,
I found the same problems with NET NamesObfuscator what I found with others. Then I tried Babel. Its trial version is also causing crash to my application. But it has some option which we can turned ON/OFF. It served my purpose. I think Babel is a very good obfuscator. One problem with it is that it has a command line UI not GUI.
Regards
Aseem
|
|
|
|
|
Aseem Sharma wrote: Now I want to obfuscate so that no one can steal my algorithms. Also so that no one can break my licensing mechanism.
I'm sorry to tell you this, but if you have .NET code then it can be read - the obfuscated code makes it harder, but not impossible to break your algorithms.
|
|
|
|
|
Hi Pete,
Thanks for the reply. I know that I cannot do anything other than just making it harder to read and understand my code. But for my small application, it would be enough. Can you suggest me a free Obfuscator that can obfuscate the WPF code and providing reasonable security?
Regards
Aseem
|
|
|
|
|
|
Hi Friend,
I found the same problems with Eazfuscator what I found with others. Then I tried Babel. Its trial version is also causing crash to my application. But it has some option which we can turned ON/OFF. It served my purpose. I think Babel is a very good obfuscator. One problem with it is that it has a command line UI not GUI.
Regards
Aseem
|
|
|
|
|