silverlight-5.0

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

夙愿已清 提交于 2020-01-13 10:04:16
问题 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

Deep Copy using Reflection in an Extension Method for Silverlight?

霸气de小男生 提交于 2020-01-10 00:27:28
问题 So I'm trying to find a generic extension method that creates a deep copy of an object using reflection, that would work in Silverlight. Deep copy using serialization is not so great in Silverlight, since it runs in partial trust and the BinaryFormatter does not exist. I also know that reflection would be faster then serialization for cloning. It would be nice to have a method that works to copy public, private and protected fields, and is recursive so that it can copy objects in objects, and

Element already child of other element error in Silverlight User Control

会有一股神秘感。 提交于 2020-01-06 19:44:15
问题 I've placed some UIElements in a row of the grid at different column positions, now I have a + button if I click on that a new row containing same UIElements should be added below the first row. but it gives me error like "Element is already child of other element". How can i get rid of this error. I need to add an duplicate copy(new reference) of the control below it in the new row. how can i do it? Any help would be appreciated.... Thanks, Gk Prajapati 来源: https://stackoverflow.com

Am I correct in understanding that vector printing in SilverLight 5 will only work with a Postscript printer?

◇◆丶佛笑我妖孽 提交于 2020-01-06 13:56:49
问题 I had read some blogs about SilverLight 5 and find it hard to believe what I read! That even on Windows, SilverLight 5 will only do vector (high quality) printing to a postscript printer. (Also happened to XML Paper becoming the format that all print drivers understood on windows…) 回答1: I found Silverlight 5: Vector and Bitmap Printing for Reports and more to be quite helpful regarding PostScript printing in Silverlight 5. In particular: If your content or your printer doesn't support

No Count overload for a String Split method in Silverlight application

ぐ巨炮叔叔 提交于 2020-01-06 05:46:07
问题 Reference to question at Splitting a filename In the Silverlight Application since there is no Count overload, I require the expected result as four string elements. NewReport 20140423_17255375 BSIQ 2wd28830-841c-4d30-95fd-a57a7aege412.zip This line of code is getting build errors in my silverlight application var strFileTokens = filename.Split(new[] { '-' }, 4, StringSplitOptions.None); Build Error: Error 4 The best overloaded method match for 'string.Split(string[], int, System

FontSize Style Ignored by TextBlock in DataTemplate

不羁岁月 提交于 2020-01-05 02:51:05
问题 The style for TextBlock (below) has no effect on the DataTemplate's TextBlock. If I change TextBlock to TextBox in both the style and template, the style applies as I would expect. Why does TextBlock ignore the style? Thank you, Ben <UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas

Complex Silverlight TreeView, is nested hierarchy possible?

删除回忆录丶 提交于 2020-01-04 06:51:09
问题 I have a DB that looks like: Locations [rootlevel] Inspections [level1] Areas [level1] Inspections [level2] So each Location can have zero or more Inspections and zero or more Areas, and Areas have zero or more Inspections. The records for Inspections all have a LocationID!=null and the AreaID=null or !=null to get this hierarchy. I would like to get all the names of each item in the table in a treeview as navigation. So far I can get EITHER Locations-->Areas-->Inspections OR Locations--

Silverlight localization

放肆的年华 提交于 2020-01-04 05:37:25
问题 What are the avaliable options for translating a silverlight 5 application (Prism + MEF)? If possible I would like to: not have resx files (I don't like the way they are managed) rather have xaml string extracted and then translated (I think there was a tool from Microsoft, that marked all XAML nodes with custom attribute and extracted the strings) have translations in external assemblies (in Prism they could be modules) and load them when needed change language at runtime I'm open to

How to put behavior in style for TextBox in Silverlight?

人盡茶涼 提交于 2020-01-02 05:34:06
问题 In Xaml, I can put customized behavior for a textbox like: <TextBox> <i:Interaction.Behaviors> <My:TextBoxNewBehavior/> </i:Interaction.Behaviors> </TextBox> I want to all TextBox has this behavior, so how to put this behavior in implicit style like? <Style TargetType="TextBox"> <Setter Property="BorderThickness" Value="1"/> .... </Style> Update: Thanks for info. Try the way as suggested below and the app is crashed: <Setter Property="i:Interaction.Behaviors"> <Setter.Value> <My

ToggleButton/CheckBox content depending on its checked state?

▼魔方 西西 提交于 2020-01-02 04:27:06
问题 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