silverlight-5.0

FrameworkPropertyMetadataOptions in Silverlight

时间秒杀一切 提交于 2019-12-06 07:10:44
Is there an equivalent of FrameworkPropertyMetadataOptions in Silverlight 5? I want to be able to FORCE a two way binding from my User Control like this: public static readonly DependencyProperty SelectedItemProperty = DependencyProperty.Register("SelectedItem", typeof(object), typeof(SearchableGridView), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnSelectedItemChanged))); Telerik has an implementation of this - but I don't want to use Telerik for this control. Rationale behind forcing the two way binding is because I

Silverlight TabItem Visibility not changing

假装没事ソ 提交于 2019-12-06 05:32:33
I have a TabControl with many TabItems binding to a ViewModel that has properties for each TabItem's Visibility. <sdk:TabControl> <sdk:TabItem Name="Inventory" Header="Inventory" Style="{StaticResource TabItemStyle}" Visibility="{Binding Permissions.Inventory, Converter={StaticResource PermissiveVisibilityConverter}, ConverterParameter='Viewer'}" DataContext="{Binding VM}" /> </sdk:TabControl> All TabItems are defaulted to a Visibility of collapsed. But when the VM changes a TabItem to Visible it does not work until you move your mouse over the control... Even if I set the visibility

Generics <T> not working in c# even run without any error

本秂侑毒 提交于 2019-12-06 01:42:24
I am creating a C# web application using Silverlight 5 (VS 2010). First I created console application in that every thing is working fine. But trouble occurs when I do it in web application. Even in web application it is working fine for particularly set data type (say for example for int instead of <T> it is working fine) but when I use generic then it doesn't work. It compiles error free but it doesn't even debug the area which is set to "toggle break point". Initially the GUI was like this: But as the control passes to the error prone part, the GUI suddenly disappears like this And the

ToggleButton/CheckBox content depending on its checked state?

女生的网名这么多〃 提交于 2019-12-05 10:22:18
What's the shortest xamly way to make a ToggleButton contents depend on its checked state? In WPF I'd probably go for a DataTrigger which doesn't exist in Silverlight. I tried the following, but it doesn't work, as soon as I include the triggers, the binding to the source is broken. The triggers won't work anyway. <ToggleButton xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" IsChecked="{Binding IsArchived, Mode=TwoWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Checked"> <ei

EF5 Code First and RIA Services Silverlight “Object reference not set to an instance of an object” error building client

╄→гoц情女王★ 提交于 2019-12-05 06:12:27
I am working on setting up a new project using Code First for entity framework 5 in silverlight using RIA services. I have created a test project due to some issues I have encountered and will post the code below. Namely, I get an 'Object reference not set to an instance of an object' error anytime I attempt to build the silverlight client project which should generate the client proxy classes. Just to be clear, this error is not while running or debugging the application, but when building it. I have isolated that this only happens if I have any navigation properties/Foreign Keys defined on

Silverlight Out-of-Browser application will not close using MainWindow.Close method

≯℡__Kan透↙ 提交于 2019-12-05 04:29:51
I have a Silverlight 5.1.10411.0 Out-of-Browser application that is NOT trusted and I am trying to close the application using the App.Current.MainWindow.Close method. According to the documentation I can only use this mechanism if one of these conditions is true: It is a trusted application (not true for my application) Before the Application.Startup event has completed (not true for my application) In response to a user-initiated action, for example, in a button Click event handler (This is what I am trying to get to work) In my attempts to get this to work I have kept things extremely

Troubleshooting Silverlight 5 and Ria services [Web-Services-AuthenticationService.svc does not exist]

老子叫甜甜 提交于 2019-12-05 04:10:09
问题 I have two different versions of a Silverlight 5 project using Ria services. Both work locally. The older version (A) works when deployed to ISS7. The new version (B) does not. There is user/password authentication that fails for version B with the error: Load operation failed for query 'Login'. the remote server returned an error: NotFound. Referencing various SO and MSDN posts over the past week, I have tried many troubleshooting techniques. Adding error logging as suggested here to the web

How to set up data binding for group radio button in Silverlight?

断了今生、忘了曾经 提交于 2019-12-05 03:42:14
Sliverlight provides radio button with GroupName to group radiobutton together with only one option from mutiple choice. It's like: <RadioButton GroupName="Option" Content="Option 1"></RadioButton> <RadioButton GroupName="Option" Content="Option 2"></RadioButton> <RadioButton GroupName="Option" Content="Option 3"></RadioButton> then in VM, I have only one property for this option,say it's MyChoice public int MyChoice {get; set;} then how to setup data binding for this case between UI and VM? Used a converter to convert bools to an int: On Xaml, asssuming options map to 1,2,3 on your MyChoice

Upgrade From Silverlight 4 to Silverlight 5 causing AccessViolationException

浪子不回头ぞ 提交于 2019-12-04 23:47:10
问题 We have upgraded our project from Silverlight 4 to Silverlight 5 and now we are experiencing AccessViolationException from time to time in different places in the code, this exception is also causing the browser to crash. Is there any guideline how to prevent this from happening? I am adding the stack trace where the AccessViolationException was popped: [Managed to Native Transition] System.Windows.dll!MS.Internal.XcpImports.SetValue(MS.Internal.IManagedPeerBase obj, System.Windows

Cannot process the message because the content type 'application/soap+msbin1' was not the expected type 'text/xml

白昼怎懂夜的黑 提交于 2019-12-04 17:02:29
I have a Silverlight application that calls a WCF successfully in my development environment (Win 7). When i inspect the content type returned in Fiddler, it is showing as below. HTTP/1.1 200 OK Cache-Control: private Content-Length: 18849 Content-Type: text/xml; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Mon, 01 Sep 2014 14:59:01 GMT However, as soon as i deploy the application in my QA server (IIS 6.0) the call to the WCF service fails with below error (again according from Fiddler) HTTP/1.1 415 Cannot process the message because the