silverlight

Silverlight HttpWebRequest.Create hangs inside async block

可紊 提交于 2019-12-20 21:46:52
问题 I am trying to prototype a Rpc Call to a JBOSS webserver from Silverlight (4). I have written the code and it is working in a console application - so I know that Jboss is responding to the web request. Porting it to silverlight 4, is causing issues: let uri = new Uri(queryUrl) // this is the line that hangs let request : HttpWebRequest = downcast WebRequest.Create(uri) request.Method <- httpMethod; request.ContentType <- contentType It may be a sandbox issue, as my silverlight is being

How can I change the VisualState in a View from the ViewModel?

ぐ巨炮叔叔 提交于 2019-12-20 20:10:44
问题 I'm new to WPF and MVVM. I think this is a simple question. My ViewModel is performing an asynch call to obtain data for a DataGrid which is bound to an ObservableCollection in the ViewModel. When the data is loaded, I set the proper ViewModel property and the DataGrid displays the data with no problem. However, I want to introduce a visual cue for the user that the data is loading. So, using Blend, I added this to my markup: <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name=

Non breaking space in XAML vs. code

…衆ロ難τιáo~ 提交于 2019-12-20 17:32:30
问题 This works fine, and correctly inserts non-breaking spaces into the string: <TextBlock Text="Non Breaking Text Here"></TextBlock> But what I really need is to replace spaces with non-breaking spaces during data binding. So I wrote a simple value converter that replaces spaces with "   ". It does indeed replace spaces with "   " but "   " is displayed literally instead of showing as a non-breaking space. This is my converter: public class SpaceToNbspConverter : IValueConverter { #region

Silverlight RIA Services - how to do Windows Authentication?

╄→尐↘猪︶ㄣ 提交于 2019-12-20 14:45:11
问题 I am building my first Silverlight 3 + RI Services application and need some help. It will be deployed in an controlled corporate intranet, 100% windows clients. I have started from the Silverlight Business Application template. These are my requirements: Upon launch the application needs to recognize the currently logged-in user. The application needs to have access to other properties of the user in AD, such as email, full name, and group membership. Group membership is used to grand

IAsyncRepository or IObservableRepository for silverlight 4 + WCF Data Services

末鹿安然 提交于 2019-12-20 14:44:38
问题 Update 2 : @Enigmativity has a brilliant answer. I've implemented this into a IObservableRepository<T> . Details in my answer below. Question: So I've changed most of the question (See edit history) I would just like it if someone commented/validated/puked on my design. =) So typically my Repos look like this: public interface IRepository<T> where T : class { T GetById(int id); IQueryable<T> GetAll(); void InsertOnSubmit(T entity); void DeleteOnSubmit(T entity); int SubmitChanges(); } But

Free vector icons [closed]

喜欢而已 提交于 2019-12-20 14:36:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Are there any free vector icons (as in, suitable for use in an open source project using WPF) for basic desktop program toolbar buttons like Back, Forward, Print, Save etc.? 回答1: Check out the SVG versions of Tango (PD) and Nuvola (LGPL). 回答2: I'm using the free Icons from Grafile. They are completely XAML. http

Preventing an ASP.NET Session Timeout when using Silverlight

一笑奈何 提交于 2019-12-20 12:51:05
问题 I'm writing a program which has both an ASP.NET configuration system and a Silverlight application. Most users will remain on the Silverlight page and not visit the ASP.NET site except for logging in, etc. The problem is, I need the session to remain active for authentication purposes, but the session will timeout even if the user is using the features of the silverlight app. Any ideas? 回答1: On the page hosting the silverlight control, you could setup a javascript timer and do an ajax call to

Using Silverlight for an entire website?

巧了我就是萌 提交于 2019-12-20 12:34:02
问题 We need to build an administration portal website to support our client/server application. Since we're a .Net shop the obvious traditional way would be to do that in ASP.Net. But Silverlight 2 will be coming out of beta a good while before our release date. Should we consider building the whole website in silverlight instead, with a supporting WCF backend? The main function of the portal will be: users, groups and permissions configuration; user profile settings configuration; file upload

Increase columns width in Silverlight DataGrid to fill whole DG width

徘徊边缘 提交于 2019-12-20 12:28:04
问题 I have a DataGrid Control which is bound to a SQL Table. The XAML Code is: <data:DataGrid x:Name="dg_sql_data" Grid.Row="1" Visibility="Collapsed" Height="auto" Margin="0,5,5,5" AutoGenerateColumns="false" AlternatingRowBackground="Aqua" Opacity="80" > <data:DataGrid.Columns> <data:DataGridTextColumn Header="Latitude" Binding="{Binding lat}" /> <data:DataGridTextColumn Header="Longitude" Binding="{Binding long}" /> <data:DataGridTextColumn Header="Time" Binding="{Binding time}" /> </data

Unit testing with Moq, Silverlight and NUnit

青春壹個敷衍的年華 提交于 2019-12-20 10:41:31
问题 I am attempting to unit test a Silverlight 3 project. I am using: Moq.Silverlight (3.0.308.2) NUnitSilverlight (http://www.jeff.wilcox.name/2009/01/nunit-and-silverlight/) When I write a test that does not use Moq, it works as it should. When I use Moq outside of a test, Moq works as it should. (I mocked a interface and did a verify in a button handler as a proof.) But when I run a unit test that uses Moq, I always get this: System.IO.FileNotFoundException: Could not load file or assembly