silverlight-4.0

Dragging a WPF user control

冷暖自知 提交于 2019-11-30 19:48:39
I created a movable UserControl <UserControl x:Class="Restaurant.Views.Managerer.TablePanel" 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.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Restaurant.Helpers.Converter" mc:Ignorable="d" x:Name="root" MouseLeftButtonDown="root_MouseLeftButtonDown" MouseLeftButtonUp="root_MouseLeftButtonUp" MouseMove="root_MouseMove" DataContext="{Binding RelativeSource=

Right-click on a Listbox in a Silverlight 4 app

假装没事ソ 提交于 2019-11-30 18:24:43
问题 I am trying to implement what I used to take for granted in Winforms applications. I am a Silverlight noob, so hopefully all this is elementary. I have a listbox in a Silverlight 4 app. I'd like to do the following: Right-click on the listbox Have the item under the location where I click highlight itself I'd like a context menu to popup (with my own items in the context menu) From my research so far, it appears that there is no ContextMenu construct in Silverlight, instead we have to build

listbox items orientation to horizontal

邮差的信 提交于 2019-11-30 17:40:35
How to make the listbox items orientation to horizontal in the default styling of a listbox. What i mean by default is the style which we get using blend. Use the ItemsPanel property to replace the panel with a horizontal StackPanel: <ListBox> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> If you want to do this in a Style, just add a Setter that sets the ItemsPanel property: <Style TargetType="ListBox"> <!-- Rest of the style --> <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate>

How to Learn Prism for Silverlight Fast?

这一生的挚爱 提交于 2019-11-30 16:35:46
I need to make Silverlight application With Prism. What could be best way to learn to make simple application with Silverlight + Prism? Also suggest any Good books for same. Thanks. Great book, I started with this book myself: Developer’s Guide to Microsoft® Prism 4: Building Modular MVVM Applications with Windows® Presentation Foundation and Microsoft Silverlight® I also have the book mentioned by 'daageu', and would also recommend it. But to accelerate the process of learning Prism even faster, I recommend the video series presented by Mike Taulty and available for free on Channel 9 . It's a

Silverlight 4 RC File Upload with Upload Progress: how to?

 ̄綄美尐妖づ 提交于 2019-11-30 16:22:19
It's been stated that one of the new features of Silverlight 4 RC is that it now supports upload progress. I'm assuming this means it's possible to make an upload file progress bar without "chunking" but I can't figure out how to do this, so how do we do this? Source code examples would be great. Thanks! Ok, after lots of playing I've got it figured out: private void UploadFile(string url, CustomPostDataInfo pdi) { // Use the client http stack! //HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest webRequest = (HttpWebRequest)WebRequestCreator.ClientHttp.Create

How to switch UI Culture of data binding on the fly in Silverlight

你离开我真会死。 提交于 2019-11-30 15:51:37
I have a TextBlock control, which is data bound to DateTime property. The text displayed something like this: Thursday, October 21, 2010 I need to switch UI Culture on the fly, using something like this: Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-de"); I've tried this to force binding to recalc: var bindingExpression = textBlock.GetBindingExpression(TextBlock.TextProperty); bindingExpression.UpdateSource(); But I still see Thursday instead of Donnerstag... How do I proceed? Any ideas? I've found a better approach, which requires to update

Silverlight Path is blurry - How to snap to pixels?

好久不见. 提交于 2019-11-30 15:13:52
问题 I have a Canvas onto which I draw a Path : <Path Data="M 380 110 v -10 l 100 -100" Stroke="#C0C0C2" StrokeThickness="1" UseLayoutRounding="True" /> Even though the StrokeThickness is set to 1, the vertical part of the path is drawn across 2 pixels and in a lighter color. I know that WPF has the SnapsToDevicePixels property that would fix it, and I read that in Silverlight there is a UseLayoutRounding property that you can use in some cases to have the same effect, however it does not seem to

MSBuild command-line error - Silverlight 4 SDK is not installed

风流意气都作罢 提交于 2019-11-30 13:36:53
问题 My MSBuild command line is as follows: msbuild e:\code\myProject.csproj /p:Configuration=Debug /p:OutputPath=bin/Debug /p:Platform=x86 /p:PlatformTarget=x86 The project builds fine on my development machine in VS2010 but not with the command above. I am running Win 7 64 - Bit. I'm getting an error that says I don't have the Silverlight 4 SDK installed but I do. I"ve read some posts that you have to set the Platform=x86 but to no avail. Here is the error message in full: Microsoft (R) Build

How to use TextBox.Watermark in Silverlight 4?

徘徊边缘 提交于 2019-11-30 13:22:39
While browsing MSDN documentation, you may come across this gem: TextBox.Watermark. "Awesome! I've been wanting a built-in way to do watermarking on my text boxes! This is great, let me go ahead and set that in XAML!" <TextBox Watermark="This is my watermark" Margin="20"></TextBox> Unfortunately, if you run this you won’t get what you expect: And the detail: What is this? Well, look at the MSDN documentation closely: That's right. It's supported in Silverlight 4, but it also says "Do not use in a Silverlight 4 application". If you do use it, you receive a System.NotImplemented exception. To

DateTime Convert from int to Month Name in C#, Silverlight

孤街浪徒 提交于 2019-11-30 10:59:10
I am trying to print out the name of the month not the integer value of each month. (for example if the date is 2/2/2002, I would like the "month" to read out "February" instead of "2." I am pulling in the system.DateTime.now to get the current month. When I try to print out the current month on the form, it just puts the correlating integer value for the month, whereas I would like to have the Month Name. I know this can be done using switch-case or if statements to individually convert the numbers into word values, but I was just wondering if there was a simple, built-in conversion command