Deep Clone of a business object: the quick and dirty way
I was implementing the IEditableObject interface for some entity classes in my current project and I needed a quick and dirty way to do the deep clone of an object, since my entity classes are shared between WCF, WPF and Silverlight (yes I’m one of the guys so crazy to build multi-target applications) I needed a method that could work in all the environments.
In WPF and WCF you can rely on the binary formatter and the serialization (entity classes have to be marked with the Serializable attribute), and use code like this:
1: public static partial class Helpers
Silverlight: Controls inside ScrollViewer - horizontal resize layout bug and related workaround
I was updating my sample on how to simulate a Window environment in Silverlight, after having implemented some fixes to the resize functions and having added the support for scrollbars inside a window, I realized a simple test form with a series of textboxes.
During the horizontal resize operation I encountered a very strange behavior: only the first textbox changed its width according to the new windows size...while all the others retained their previous value; when you start a vertical resize operation all the textboxes were redrawn with the correct width.
To be sure it wasn’t my control template’s fault and to try to reproduce this situation I prepared a simple test page, something like:
1: <ScrollViewer x:Name="ScrollBox" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
Invoking a Java/AXIS Web Service from .NET: the ‘return null’ issue
When you try invoke a Java/Axis Web Service from a proxy class generated by Visual Studio 2005 or Visual Studio 2008 you often crash against the ‘return null’ issue.
The web service seems to get called correctly and it responds to your client in the right way (you have no exception of any sort), but your returned object is null, it happened to me to face this situation today for the first time, there are a couple of things you can do to debug and resolve this situation:
- Let’s consider our function call:
1: [Test]
Silverlight 2.0 RTW silently released
Microsoft silently released Silverlight 2...if you navigate to www.silverlight.net and go to the ‘Get Started’ section you will notice that the ‘Beta 2’ marker on the Silverlight download button were removed.
Plus the developers tools were updated too, you can reach the new versions from the same section you used to get the RC0 version...I just double checked the page and found that they have already changed the ‘Get Section’ to point to the new tools.
So...to get the latest version navigate to: http://silverlight.net/GetStarted/
Related Content
- Silverlight 2 RC0 Available (26/08/2015)
- Silverlight Datagrid Updated (01/12/2009)
- Last few days to sign up for the 12th DotNetMarche / Community Tour 2009 workshop (26/08/2015)
- Getting ready for the 12th DotNetMarche Workshop “Community Tour 2009” (12/03/2009)
- Workshop: ‘Silverlight in Action - a starting point for Line of Business Applications’ (26/08/2015)
- More related document (41)
XAML Power Toys and Mole
Reading Tim Heuer's Blog I discovered these two very nice tools written by Karl Shifflett. They are a very nice XAML code generator to build basic business form in WPF and Silverlight, and a tool that provides a series of advanced Visualizers that interact with Visual Studio 2008 (excerpt from mole documentation: Mole was designed to not only allow the developer to view objects or data, but to also allow the developer to drill into properties of those objects and then edit them).
I played with them a bit and found that both XAML Power Toys and Mole are extremely easy to use: XAML Power Toys can speed-up the process of creating a basic business form a lot, Mole is an invaluable support during debugging sessions; both the programs are offered for FREE and they come with a very good documentation and with a series of videos/tutorials that explains how to use them.
The guys working on these projects made a very good job and their products should be part of the toolset any WPF/Silverlight developer should use (for sure they go in my favorite programs list).
Related Content
- Silverlight: simulate a 'Windows' desktop application - part 1 (26/08/2015)
- Silverlight: Custom Buttons with Templates (09/01/2008)
- Silverlight: How to Add a Context Menù to a FrameworkElement (26/08/2015)
- Silverlight: The Power of (26/08/2015)
- Silverlight: Dropdown Menu Control (10/07/2008)
- More related document (51)
The importance of having a License
Sometimes, especially when you have a technical blog and publish code examples or even fully working controls, it can be important to clearly states the License under which you release your work and how others can/should use it.
I always underestimated this point and didn’t spent too much time on it in the past, but recently I started to look around at what types of licenses one can use for the software he produces that he want to share with the community.
Today, after checking some options, I decided to opt for a Creative Common license system (have a look at http://creativecommons.org/) which also allow distribution and commercial use of the samples I will post here.
If you have a blog and/or post code samples attaching a license to them, will help your readers to use the code the way it was meant to be by the author.
Technorati Tags: Software License,CopyrightRelated Content