Ιούνιος 2012 - Δημοσιεύσεις

HowTo: Set UI language (CurrentUICulture) in Silverlight
20 Ιουνίου 12 04:11 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
At LvS (the opensource application of LeViS), I’ve been using this (VB.net) code to set the UI language (for example to Greek): Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("el") Others seem to have been using (C# – that’s why there is a trailing semicolon): Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("el"); assuming System.Globalization and System.Threading namespaces have been imported. However, now that I’m [...]
Δημοσίευση στην κατηγορία: , , , , , , ,
Zoom and Pan control for WPF and Silverlight (via WPF compatibility layer)
18 Ιουνίου 12 08:50 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
I’ve managed to combine http://www.codeproject.com/Articles/85603/A-WPF-custom-control-for-zooming-and-panning and a cut-down version of it for Silverlight that was out there: http://www.codeproject.com/Articles/167453/A-Silverlight-custom-control-for-zooming-and-panni I did it in a way that the Silverlight version is source-code compatible with the WPF version (via a WPF compatibility layer that even implements value coercion), so that both the WPF and the Silverlight projects share [...]
Δημοσίευση στην κατηγορία: , , , , , ,
InitializeError Message: Failed to load a platform extension in Silverlight
18 Ιουνίου 12 04:21 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
If you get an error like: Unhandled Error in Silverlight Application Code: 2153 Category: InitializeError Message: Failed to load a platform extension. Possibly corrupt or invalid file: … when you try to launch your Silverlight application (especially if you have the project set to use an autogenerated test page), you should read: http://forums.silverlight.net/t/185747.aspx/1 In my [...]
Δημοσίευση στην κατηγορία: , , , , ,
IsolatedStorageSettings for WPF
18 Ιουνίου 12 04:01 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
System.IO.IsolatedStorageSettings doesn’t exist in WPF (only in Silverlight) but can easily be ported from Mono project’s Moonlight implementation (the Moonlight project home is at http://www.mono-project.com/Moonlight), as suggested at: http://groups.google.com/group/wpf-disciples/browse_thread/thread/4ed6c009f3fb7d69 I found that implementation at the following URL: http://vega.frugalware.org/tmpgit/moon/class/System.Windows/System.IO.IsolatedStorage/IsolatedStorageSettings.cs Did some modifications to IsolatedStorageSettings.cs to make it work with WPF (whether the application is deployed via [...]
Δημοσίευση στην κατηγορία: , , , , , , ,
HowTo: Load a XAML ResourceDictionary from a .NET assembly
11 Ιουνίου 12 07:08 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Copying here my answer at: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/11a42336-8d87-4656-91a3-275413d3cc19 What seems to work for me is the following (copying from the source code of http://ClipFlair.codeplex.com [currently under development]) note I’m using Build Action = "Page" and Custom Tool="MSBuild:Compile" at the properties of Themes\DropDownTheme.xml and Themes\RotateHorizontalTheme.xaml, as was for Themes\Generic.xaml. Seems to work OK (probably this is faster at [...]
Δημοσίευση στην κατηγορία: , , , , , , , , , , ,
What to do if Generic.xaml doesn’t get loaded for WPF control
10 Ιουνίου 12 05:26 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Just came across http://wangmo.wordpress.com/2007/09/27/themesgenericxaml/ which gave me a hint on why a WPF control wasn’t getting instantiated correctly when loaded from an external assembly (dll): to load generic.xaml for WPF, at the start of Properties\AssemblyInfo.cs you need (note this isn’t used/needed in Silverlight): using System.Windows; and at the end of Properties\AssemblyInfo.cs you need: [assembly: ThemeInfo( [...]
Δημοσίευση στην κατηγορία: , , , , , ,
Fix: compile CSpeex audio codec at Silverlight 4 RC+ and Silverlight 5
09 Ιουνίου 12 02:19 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Just added an issue to CSpeex project – http://cspeex.codeplex.com/workitem/18209 – with some fixes to make it compile for Silverlight 4 RC and higher (was for Silverlight 4 Beta), however still have issues with it not working correctly. Tagged: Audio, Capture, Codec, Demo, Silverlight, Speex, Webcam
Δημοσίευση στην κατηγορία: , , , , , , ,
Validating E-mails using Regular Expressions in Java
01 Ιουνίου 12 05:27 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
To sum up the discussion at http://stackoverflow.com/questions/1360113/is-java-regex-thread-safe/, you can reuse (keep in static variables) the compiled Pattern(s) and tell them to give you new Matchers when needed to validate those regex pattens against some string: import java.util.regex.Matcher; import java.util.regex.Pattern;  /** * Validation helpers */ public final class Validators {  private static final String EMAIL_PATTERN = [...]
Δημοσίευση στην κατηγορία: , , , , ,

Search

Go

Ιστορικό Δημοσιεύσεων

Συνδρομές