Difference between revisions of "Silverlight"
From Richard's Wiki
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | * [http://blog.thekieners.com/2010/04/21/opening-an-microsoft-office-documents-with-silverlight/ Opening a Microsoft Office document with Silverlight] | ||
+ | * [http://blog.kevindockx.com/post/Using-a-Channel-Factory-in-Silverlight-(instead-of-adding-a-Service-Reference)-With-cows.aspx Using a ChannelFactory in Silverlight (calling WCF without Service Reference)] | ||
+ | * [http://blogs.msdn.com/b/carlosfigueira/archive/2008/03/07/enabling-cross-domain-calls-for-silverlight-apps-on-self-hosted-web-services.aspx Enabling cross-domain calls for Silverlight apps on self-hosted web services] | ||
+ | |||
* [http://msdn.microsoft.com/en-us/library/ee796241(v=vs.91).aspx Walkthrough: Displaying Related Data in a Silverlight Business Application - WCF RIA Services (MSDN] | * [http://msdn.microsoft.com/en-us/library/ee796241(v=vs.91).aspx Walkthrough: Displaying Related Data in a Silverlight Business Application - WCF RIA Services (MSDN] | ||
** Edit a Domain Service Query to Include Related Data | ** Edit a Domain Service Query to Include Related Data |
Latest revision as of 17:34, 4 October 2011
- Opening a Microsoft Office document with Silverlight
- Using a ChannelFactory in Silverlight (calling WCF without Service Reference)
- Enabling cross-domain calls for Silverlight apps on self-hosted web services
- Walkthrough: Displaying Related Data in a Silverlight Business Application - WCF RIA Services (MSDN
- Edit a Domain Service Query to Include Related Data
- Add [Include] attribute in .metadata.cs
Need to also add this to web.config:
<configSections> <sectionGroup name="system.serviceModel"> <section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </sectionGroup> </configSections>
- Silverlight 4 data-bound combobox dropdown
- Silverlight datagrid double click behavior
- To get dates to appear in correct dd/mm/yyyy Australian form in autogenerated DataGrid columns, do this in UserControl constructor:
// This makes dates appear in correct local form in autogenerated DataGrid columns (yippee!) Language = System.Windows.Markup.XmlLanguage.GetLanguage(System.Threading.Thread.CurrentThread.CurrentCulture.Name);
- Accessing Web Services in Silverlight (MSDN) - Useful umbrella article, has detailed articles on security and service types supported
- Making WCF RIA Services work in a DMZ/Multitier architecture using Application Request Routing
- GridSplitter with a Collapse Button
- Silverlight TV Episode 26: Exposing SOAP, jSON and OData Endpoints from RIA Services
- How to expose a WCF RIA service as a “standard” WCF Service
- Walkthrough: Creating a RIA Services Class Library
- Silverlight logging
- Sharing ASP Session state with Silverlight
- Tutorial For Configuring Silverlight 4, Entity Framework And WCF RIA Services In Separate Component Assemblies (DLL’s)
- Using MEF to Expose Interfaces in Your Silverlight MVVM Apps (Visual Studio Magazine)
- 4 Simple Steps to Consume WCF Service using Silverlight
- ASP.NET/Silverlight: How to pass credentials to Silverlight control
- Silverlight (3, but excellent) Expression Blend tutorials
- To get rid of spurious HTML scrollbar outside Silverlight in IE, add this style to the body tag in the html page hosting the Silverlight: style="overflow:hidden"
- To get rid of warnings like:
Type of 'Blah.Blah.Blah' is not CLS-compliant
when you have a separate assembly for models, etc, add the following line to AssemblyInfo.cs in the library (ie non-UI) assembly:
[assembly: CLSCompliant(true)]
- Silverlight 4 design-time sample data. Add a static collection to the view model, and set the following as the parent datacontext, remember to set ItemsSource to {Binding name_of_static_property_which_is_the_sample_collection}:
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d:DataContext="{d:DesignInstance local:ViewModelClassName, IsDesignTimeCreatable=True}"
- Debug WCF Services in Silverlight Apps - set up separate WCF Service Library in Silverlight project, use wcftestclient command-line tool
- How to Bind Silverlight DataGrid From IEnumerable of IDictionary by Transforming Each Dictionary Key Into a Property of Anonymous Typed Object - see also How to Display DataSet in Silverlight DataGrid
- Customizing Silverlight 3 DataGrid Headers
- Top 10 Things I Wish I Knew Before I Started My Silverlight 4 Project(July 2010)
- 4 Simple Steps to Consume WCF Service using Silverlight
- Defining Silverlight DataGrid Columns at Runtime
- Interaction between Silverlight and HTML
- How to Construct a Reusable Silverlight ASP.NET User Control
- Silverlight 3 Drag Behavior (using WriteableBitmap())
- Silverlight 4 Toolkit ContextMenu
- Call Javascript Method from Silverlight and Vice Versa
- Silverlight 4 + RIA Services - Ready for Business: Index (excellent introduction)
- Silverlight QuickStart - adding a WCF RIA Service
- Silverlight XAML Primer 5: Working with Radial Gradients
- Visibility to boolean ValueConverter
- To fix problem with default Silverlight BusinessApplication template generated projects and Windows authentication, override the AuthenticationService GetAuthenticatedUser method in the web project, like this (add "using System.Web.Configuration;"):
// Have to override GetAuthenticatedUser when using Windows authentication. // Even when Windows auth is defined, the auth subsystem insists on looking for an // AspNetProvider SQL database. Code below gets the user information from the // principal in the Windows Auth case. protected override User GetAuthenticatedUser(System.Security.Principal.IPrincipal principal) { User user = new User(); Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); SystemWebSectionGroup grp = (SystemWebSectionGroup)config.GetSectionGroup("system.web"); AuthenticationSection auth = grp.Authentication; if (auth.Mode == AuthenticationMode.Forms) { user = base.GetAuthenticatedUser(principal); } else if (auth.Mode == AuthenticationMode.Windows) { string[] a = principal.Identity.Name.Split('\\'); //System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://" + a[0] + "/" + a[1]); //string Name = ADEntry.Properties["FullName"].Value.ToString(); user.Name = a[a.Length-1]; } return user; }
- Dropshadow effect (in Resources):
<DropShadowEffect x:Key="DropShadow" BlurRadius="15" Color="Black" Direction="320" Opacity="1.0" ShadowDepth="10" />
- To use (in xaml):
Effect="{StaticResource DropShadow}"
- To use (in .cs):
control.Effect = Application.Current.Resources["DropShadow"] as System.Windows.Media.Effects.Effect
- To get position of a UIElement:
// Obtain transform information based off root element UIElement element = this as UIElement; GeneralTransform gt = element.TransformToVisual(Application.Current.RootVisual); // Find the four corners of the element Point topLeft = gt.Transform(new Point(0, 0)); Point topRight = gt.Transform(new Point(element.RenderSize.Width, 0)); Point bottomLeft = gt.Transform(new Point(0, element.RenderSize.Height)); Point bottomRight = gt.Transform(new Point(element.RenderSize.Width, element.RenderSize.Height));
Silverlight & CAL (PRISM)
- Silverlight 3 and MVVM (Silverlight forum)
- Prism for Silverlight - An Intro to Composite Applications
- Silverlight 4 - MVVM with Commanding and WCF RIA Services
Silverlight Control Libraries & Resources
- Silverlight Toolkit (Codeplex)
- Blacklight
- Silverlight Chart with Horizontal Legend - Custom Chart Template
- Silverlight Chart Builder
- Infragistics exploding pie chart
Silverlight (&WPF) Pixel Shader Resources
- Shazzam Tool = Compile HLSL shader definition to something consumable by Silverlight & WPF
- Silverlight Pixel Shader Effects (MSDN)
- High Level Shader Language (Wikipedia)
- WPF ShaderEffect Generator (CodePlex) VS 2010 plugin - takes HLSL .fx file & includes it in the project as a compiled resource)
- HLSL Introduction - see section on Phong shaders