silverlight-4.0

Silverlight: How to bind to parent view's DataContext?

我怕爱的太早我们不能终老 提交于 2019-12-24 16:12:00
问题 I have a ParentView that contains a childView <UserControl ... x:Name="MyParentView"> <Grid> <sdk:TabControl Name="ContactTabControl"> <sdk:TabItem Header="Contact" Name="CustomerTabItem"> <Grid> <Views:CustomerView/> </Grid> </sdk:TabItem> </sdk:TabControl> </Grid> </UserControl> Within my CustomerView I would like to bind the Firstname textbox to Parent's DataContext. I have tried this inside the CustomerView: <TextBox Text={Binding ElementName=MyParentView, Path=DataContext.Firstname} /> I

Silverlight printing busy\progress bar

喜夏-厌秋 提交于 2019-12-24 15:48:20
问题 I'm using Silverlight 4 to print but I would like some sort of progress bar or busy indicator. I've tried to using a progress bar but it is not really working. The 2 issues I have are: the progress bar does not indicate progress, I have IsIndeterminate=True, but it does not animate when printing starts (Print dialog's Print button is clicked) the progress bar visibility is not being set at the proper time, depending upon where I put the code to set visibility it displays either too soon

How to do dynamic binding with Listbox in silverlight?

隐身守侯 提交于 2019-12-24 11:36:27
问题 I am developing silverlight 4 application. I am using the following listbox for dynamic binding <ListBox Margin="44,100,46,138" x:Name="lstbox1"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding A1}" Foreground="Gray" FontSize="14" Width="100" Height="20" ></TextBlock> <TextBlock Text="{Binding A2}" Foreground="Red" Width="100" Height="20" ></TextBlock> <Line X1="-3400" Y1="32" X2="10" Y2="32" Stroke="Gray" StrokeThickness="1"/> </StackPanel>

string format not working for DataGridTextColumn?

╄→гoц情女王★ 提交于 2019-12-24 11:30:26
问题 Put folloing xaml for Currency formating, but not working. Why? <sdk:DataGridTextColumn Header="Amount" Binding="{Binding Amount, StringFormat={}{0:C}}" /> 回答1: Try... <sdk:DataGridTextColumn Header="{Binding Amount, StringFormat=Amount: {0:C}}"/> 回答2: Make sure that Amount is in numeric type. Strings won't format. 来源: https://stackoverflow.com/questions/4465348/string-format-not-working-for-datagridtextcolumn

Bad CRC32 in GZIP stream

你离开我真会死。 提交于 2019-12-24 11:24:07
问题 I am using DevForce 2010 and Silverlight 4. When saving entities that contain large amount of binary data, I get this error: Unhandled Error in Silverlight Application The remote server returned an error: NotFound. When debuging the application I see these errors: Unhandled Error in Silverlight Application Insufficient memory to continue the execution of the program. Bad CRC32 in GZIP stream. I found this thread on Ideablades forum that discusses the problem: http://www.ideablade.com/forum

Turn event into a async/blocking call on Windows Phone 7 (C#)

那年仲夏 提交于 2019-12-24 11:08:03
问题 (I asked this question earlier, but had forgotten to mention some constraints. This is for Windows Phone 7.1 (Mango) with Silverlight 4 and C# 4, which lacks System.Threading.Tasks , await and more. I'm asking again in hope for a native solution without 3rd party libs like this.) I'm wrapping a library for my own use. To get a certain property I need to wait for an event, which fires pretty quick. I'm trying to wrap that into a blocking call. Basically, I want to turn void Prepare() { foo =

Silverlight PRISM Creating a custom module catalog

杀马特。学长 韩版系。学妹 提交于 2019-12-24 10:41:11
问题 I have created a silverlight application with PRISM and MEF. Is there a way to populate the modules catalog through some web service or database call? The example shown in the PRISM documentation gets the module information through XAP file which is included in the Shell project. In my case i need to get this list from some service. I read some articles which suggested to create a custom ModuleCatalog which implements IModuleCatalog. I am not able to find any example or code snippet on how to

How to do a server-side Insert/Update (Upsert) from Silverlight RIA services

落花浮王杯 提交于 2019-12-24 10:25:36
问题 While RIA services seems very good for table operations & queries, I am stuck on one traditional update situation. The UPSERT (Update if exists, else Insert new): First: I want to add a record server-side if the record does not already exist, otherwise if it already exists, I want to update one of its current field values. Second: I do not want to query the database from client-side, to see if the record exists. I just want to call an "UpsertData" method on RIA services and have the add or

Error creating silverlight 4.0 project for windows phone

烂漫一生 提交于 2019-12-24 10:23:06
问题 Trying to create a new project in VS2010 (on Windows 7 64-bit) of type Windows Phone Application , I get the error: You need to install the Silverlight 4.0 SDK before creating a Silverlight for Windows Phone project. Download the Silverlight 4.0 SDK from: [link omitted] If I try to install Silverlight 4.0 SDK, I get: A newer version of Microsoft Silverlight 4 SDK is already installed. I have completely uninstalled and resintalled VS2010 (and SP1 service pack) as well as everything related to

Does Silverlight 4.0 support bindings in a style setter?

我的梦境 提交于 2019-12-24 10:07:47
问题 I am trying to port an application from WPF to Silverlight but it fails on some very simple binding. I have the following simple example: <ListBox > <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="Canvas.Top" Value="{Binding X}"></Setter> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemsPanel> <ItemsPanelTemplate> <Canvas></Canvas> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> However, Silverlight parsing crashes. However, if I replace the binding