silverlight-4.0

Validation fired but Red Border does not appear with User Control in Silverlight 4

时光毁灭记忆、已成空白 提交于 2019-12-11 00:43:15
问题 I have created custom User Control which contain TextBox and PasswordBox. I bind TextBox to UserName and PassowrdBox also. The UserName is defined in my LoginViewModel class with [Required] attribute. Now my cursor is leaving from TextBox without entering any value then UserName property fire property changeed notifcation (INotifyPropertyChanged), but dose not mark my Textbox (which is inside the User Control) with Red border. Following is code of my User Control. RestrictedBox.xaml <Grid x

How do I Manually Invoke/Raise Mouse Events in Silverlight 4?

元气小坏坏 提交于 2019-12-11 00:04:41
问题 In Silverlight 4, I wish to invoke one of the mouse button click events when the right mouse button is clicked. I have the RightMouseButtonDown click event wired up, but I don't know how to manually fire the MouseLeftButtonUp event. I have tried raising the event in the following fashion. private void MainLayoutRootMouseButton(object sender, MouseButtonEventArgs e) { MouseLeftButtonDown(sender, e); } However, a compiler error occurs: "The event 'System.Windows.UIElement.MouseLeftButtonDown'

How are the XAP files structured?

大兔子大兔子 提交于 2019-12-10 23:32:23
问题 Questions: Are XAP files self-contained? Do they link in all DLLs I have referenced in the project? If I need to distribute my app, is all I have to do is hand someone the XAP file? 回答1: By default, yes. For alternatives, see answer 3. By default, all except the core DLLs installed by the runtime; it will contain anything from the SDK, Toolkit, 3rd party controls, or your own libraries. By default, yes. However, there is an option as of Silverlight 3 to package certain assemblies (for example

Click-to-edit control - how to do it?

这一生的挚爱 提交于 2019-12-10 21:37:44
问题 I'm learning Silverlight using Silverlight 2.0 Unleashed + Silverlight 4.0 Unleashed and, well, just messing around with it :-) As part of that, I'm trying to develop what should be a very simple content control: A label that you can edit by clicking on it. I took my inspiration from another SO question (Click-to-edit in Silverlight) but I'm having a few issues related to me being very new to Silverlight. :) I'll first post the code, then my questions. This is my XAML: <ContentControl x:Class

EventTrigger not working inside ItemsControl in MVVM

[亡魂溺海] 提交于 2019-12-10 21:24:33
问题 I want to bind multiple buttons dynamically in MVVM. 1.I Dynamically created buttons using ItemControl 2. It did not Invoke Trigger Click Event. Please help me on this. <ItemsControl ItemsSource="{Binding ComponentList,Mode=TwoWay}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Button Tag="{Binding WorkFlowCompId}"> <Button.Content> <TextBlock Text="{Binding ComponentName,Mode=TwoWay}"/> </Button.Content> <i:Interaction.Triggers> <i:EventTrigger EventName=

Looking for regex/code for hostname/machine name validation

陌路散爱 提交于 2019-12-10 21:11:30
问题 Looking for hostname validation regex. Regular expression to match DNS hostname or IP Address? In that link gentlemen propose a decent regex. I have a few problems/questions with that: On windows computers/networks names like 1abcd are allowed (verified on our local network) In the proposed regex the dot might appear only once. I'd assume that abc.def.gh is a valid hostname as well, isn't it. Strange, but also couldn't find any .NET class that can validate hostname string (is it the situation

AesManaged and RijndaelManaged

房东的猫 提交于 2019-12-10 20:12:28
问题 Im currently developing a Silverlight application that connects to an old webservice. Our old webservice uses an encryption tool which silverlight does not support. Finally, we decided to used AesManaged for encryption, however, our webservice does not support AesManaged. Is their a way to decrypt an AesManaged to RijndaelManaged? If yes, can you please post a sample snippet? Your feedback is highly needed. Thank you. 回答1: As long as you make sure to set the blocksize of RijndaelManaged to

Silverlight: Is it possible to use custom mouse cursors/pointers?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 19:13:46
问题 I have just found this page indicating the support for Silverlight mouse cursors: http://msdn.microsoft.com/en-us/library/system.windows.input.cursor(VS.95).aspx Is that it!!! :-| what are they thinking, at least there is stylish looking Eraser! Is there aany other way to use custom cursors? How efficient/usable would it be to hide the cursor and show a png instead? 回答1: I found an example here: http://nokola.com/blog/post/2009/12/13/Adorners-in-Silverlight-Move-Size-Rotate-Custom-Mouse

Can a DomainService return a single custom type?

空扰寡人 提交于 2019-12-10 19:09:09
问题 I would like a method on my in my domain service similar to: public SystemState GetSystemStatus() { return new SystemStatus { InterestingStatusValue1 = 1223, OtherInterstingStatusValue = "abc", } } That doesn't work. Nothing is auto-generated for the Silverlight client app. Howerver if I make this an IQueryable method, then I get something generated on the client. I'll get a SystemStates property and a Query method on the context object. Is there no way to make this a simple WCF call? I

Why won't my Silverlight Application load in Internet Explorer?

故事扮演 提交于 2019-12-10 18:44:46
问题 For some strange reason my Silverlight 4 application isn't loading in Internet Explorer. I see no error messages, just a blank screen. It works fine in Chrome. Any ideas? 回答1: When SL has failed to load for me in a browser it is usually related to mime-type. It would be worth checking to make sure it is set correctly by the server: http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/ 回答2: I'm not sure exactly why, but the application didn't like one of my div tags.