silverlight-3.0

windows phone 7 image checkbox

不羁岁月 提交于 2020-01-06 07:26:34
问题 I'm trying to create a simple checkbox, which is an image instead of the classic one. I managed to create the control and assign it different behaviours, but I can't make it to work when checking/unchecking. Here's the code : <UserControl.Resources> <ControlTemplate x:Key="CheckboxImageTemplate" TargetType="CheckBox"> <Image Name="imgTreble" MinWidth="100" Source="Images/treble_unchecked.png"/> </ControlTemplate> </UserControl.Resources> <StackPanel x:Name="LayoutRoot" Background="

How do I replace a ControlTemplate part at runtime, in Silverlight 3?

╄→гoц情女王★ 提交于 2020-01-06 01:52:07
问题 I'm writing a custom control which uses a template defined in the resources section of my XAML and I'd like to replace one or more template parts in an instance of my control at runtime. For example, if I have a part named "ActivePart" in the control's template, how do I replace the ActivePart's FrameworkElement in an instance of the control with a new FrameworkElement? I realise the Control.Template property is writeable, but I'd prefer to find a way to replace a specific part of that

Custom UserNamePasswordValidator with Silverlight 3.0

杀马特。学长 韩版系。学妹 提交于 2020-01-05 13:09:25
问题 I have implemented a WCF service that uses a TransportWithMessageCredential binding and a custom UserNamePasswordValidator. I have a Silverlight 3 client connecting to this service. If I set valid credentials it works perfect, however, in the username validator I throw a SecurityTokenException if the username and password does not match. Now I have implemented a dummy service call just to verify the credentials, is there a "nicer" way of checking the credentials. A service method that accept

Silverlight 3.0 Binary Serialization Support?

柔情痞子 提交于 2020-01-05 05:25:40
问题 Can I deserialize an object in the Silverlight 3.0 runtime that was serialized using the full .NET 2.0 runtime using the BinaryFormatter? I am using the following code to serialize an object to a ByteArray which we write to a DB table: MemoryStream serStream = new MemoryStream(); BinaryFormatter binFormatter = new BinaryFormatter(); binFormatter.Serialize(serStream, csMetric); serStream.Position = 0; return serStream.ToArray(); The Silverlight client then needs to retrieve this binary data

Silverlight 3.0 Binary Serialization Support?

泄露秘密 提交于 2020-01-05 05:25:15
问题 Can I deserialize an object in the Silverlight 3.0 runtime that was serialized using the full .NET 2.0 runtime using the BinaryFormatter? I am using the following code to serialize an object to a ByteArray which we write to a DB table: MemoryStream serStream = new MemoryStream(); BinaryFormatter binFormatter = new BinaryFormatter(); binFormatter.Serialize(serStream, csMetric); serStream.Position = 0; return serStream.ToArray(); The Silverlight client then needs to retrieve this binary data

Silverlight Toolkit Modifying October 2009 Source

↘锁芯ラ 提交于 2020-01-05 03:44:09
问题 I have some changes I need to make to the Silverlight toolkit Charting source I downloaded the Silverlight toolkit ... unzipped the source to a new directory Added the Controls.DataVisualization.Toolkit.csproj Project to my Solution Removed The reference in my silverlight application to System.Windows.Controls.DataVisualization.Toolkit and Added A project Reference to The Controls.DataVisualization.Toolkit.csproj Project I then changed the Legend.xaml to <Style TargetType="datavis:Legend">

How to display value from a combobox in silverlight?

时光毁灭记忆、已成空白 提交于 2020-01-04 14:26:09
问题 I'm trying to learn Expression Blend and SilverLight. What I'm trying to achieve is output the selected item from the combobox into a textBlock. Can any one point me in the right direction or show me some C# on how this is done? This is my current code: private void GetSubmitBtn(object sender, System.Windows.RoutedEventArgs e) { this.Message.Text = "Hello there " + this.Firstname.Text + " " + this.Surname.Text + ". You come from " + this.Origin.SelectedItem.ToString(); } 回答1: You could do

How does one detect SetBinding success or failure in Silverlight?

跟風遠走 提交于 2020-01-03 17:23:46
问题 Simple binding from C#: Binding binding = new Binding(SourceName); binding.Mode = BindingMode.TwoWay; BindingExpressionBase beb = SetBinding(SourceDependencyProperty, binding); I would like to detect whether or not the SetBinding was successful. SetBinding obviously knows when it has an issue because it displays in the Output window tracing when the application is running: System.Windows.Data Error: BindingExpression path error: 'InterestRate' property not found on 'Tc.Views.TestAccount' ...

Silverlight 3 alternative to FileVersionInfo.GetVersionInfo

霸气de小男生 提交于 2020-01-02 04:45:14
问题 Within a Silverlight 3.0 application I want to use the AssemblyFileVersion to display the version information of the application. This is not the same as the AssemblyVersion and is typically retrieved in a .NET application using code such as: var executingAssembly = Assembly.GetExecutingAssembly(); var fileVersionInfo = FileVersionInfo.GetVersionInfo(executingAssembly.Location); var versionLabel = fileVersionInfo.FileVersion; Unfortunately Silverlight 3.0 runtime does not include the

How to combine .NET RIA Services with MVVM in Silverlight 3?

落爺英雄遲暮 提交于 2020-01-01 18:09:11
问题 The .NET RIA Services are described as an n-tier framework for Silverlight. I have been wondering what the relation is between this framework and the Model-View-ViewModel pattern. Are they in conflict or can you see the potential for synergic combination? 回答1: .NET RIA Services and MVVM are synergistic, and aren't in conflict. For example, if I write a Catalog domain service that exposes Products and Categories on the server, and correspondingly have a Catalog domain context on the client...