silverlight-5.0

Binding does not update usercontrol property correctly MVVM

与世无争的帅哥 提交于 2019-12-23 19:41:16
问题 Edit: Old code removed I place it on my MainWindow.xaml <SpinTextBlock:SpinTextBlock Text="{Binding Path=DataContext.WelcomeTitle, ElementName=Window,UpdateSourceTrigger=PropertyChanged}" Height="60" Width="40" x:Name="TextBlock"/> And bind it to a property in MainViewModel.cs public string WelcomeTitle { get { return _welcomeTitle; } set { if (_welcomeTitle == value) { return; } _welcomeTitle = value; RaisePropertyChanged(WelcomeTitle); Dispatcher.CurrentDispatcher.BeginInvoke( new Action

“The tag 'MenuItem' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit'” error

♀尐吖头ヾ 提交于 2019-12-23 07:26:34
问题 I'm getting an error trying to build a Silverlight application on a new machine. (Silverlight 4, Visual Studio 2010) This application compiles without error on four other machines. The error is: the tag 'MenuItem' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit'. The references appear to be pointer to the correct assemblies. Has anyone else ever had this problem? 回答1: Another reason this issue may occur is due to missing a

FrameworkPropertyMetadataOptions in Silverlight

百般思念 提交于 2019-12-22 14:03:51
问题 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

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

纵饮孤独 提交于 2019-12-22 04:14:09
问题 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

Silverlight sockets: mimic framework Bind, Listen and Accept methods?

点点圈 提交于 2019-12-21 21:41:10
问题 I have this .NET Framework C# class that practically acts as a wrapper for TCP connections around the Socket class in the System.Net.Sockets namespace. Recently I have migrated the API of this wrapper class to Silverlight, but because of the limitations of the Socket class in Silverlight, as well as the normal trust restrictions with respect to avaiable ports, client access policy etc., I have only implemented network client support in my Silverlight version. Now, with Silverlight 5 (RC), it

Silverlight async unit testing

你。 提交于 2019-12-21 02:53:09
问题 I'm having a weird issue with Silverlight Unit Test Framework. The very first method executed fails, every time. I have a second test with the exact same code, and it passes. The strange thing about the first time it's called is that it actually waits for the timeout and then executes the repository call (underneath it's an HTTP PUT if you care). Here's the code - the first one fails every time, second one passes every time: [TestMethod] public void AuthShouldSucceed() { var autoResetEvent =

Cannot implicitly convert type 'System.Collections.Generic.List<T>' to 'System.Linq.IQueryable<T>'

怎甘沉沦 提交于 2019-12-21 02:28:34
问题 I am trying to create a query in my domain service (VS 2010 Silverlight Business Application) that returns the results from inspection readings that came out as a specific value, my database is set up as: Locations a) Inspections b) InspectionItems c) InspectionReadings a) Areas b) Inspections c) InspectionItems d) InspectionReadings So, as you can see, there are inspection readings for locations under areas and locations. I have a POCO called name StatusList: public class StatusList { [Key]

Scientific notation XAML

拜拜、爱过 提交于 2019-12-20 06:15:30
问题 I'm using scientific notation in XAML. I do: <TextBox Text="{Binding Path=CELULARIDAD_CFU, StringFormat='e6'}"/> The problem is that for 1710000 is showing: 1.710000e+006, which is correct but I would like to see 1.71e+6. How is this specified in XAML? (Not in code) 回答1: I believe you should use the G format specifier to get (almost) what you want. <TextBox Text="{Binding Path=CELULARIDAD_CFU, StringFormat='G'}"/> Within a certain range (different for different number types, see link) the

'windows-1255' is not a supported encoding name

孤街醉人 提交于 2019-12-20 05:01:25
问题 I'm writing a silverlight 5 application in which I need to read a text file from the user. Here is a snippet of my code: using (StreamReader reader = new StreamReader(fileStream, Encoding.GetEncoding("windows-1255"))) But I get the exception: "'windows-1255' is not a supported encoding name". Why is that? And then, how do I read a file in the "windows-1255" encoding? (Hebrew) 回答1: There are not many supported encodings in Silverlight. Basically, you get UTF8 and UTF16, see http://msdn

'windows-1255' is not a supported encoding name

試著忘記壹切 提交于 2019-12-20 05:01:10
问题 I'm writing a silverlight 5 application in which I need to read a text file from the user. Here is a snippet of my code: using (StreamReader reader = new StreamReader(fileStream, Encoding.GetEncoding("windows-1255"))) But I get the exception: "'windows-1255' is not a supported encoding name". Why is that? And then, how do I read a file in the "windows-1255" encoding? (Hebrew) 回答1: There are not many supported encodings in Silverlight. Basically, you get UTF8 and UTF16, see http://msdn