Useful Tip: Solution for known issue with Merged Dictionaries in App.xaml (VS 2010 RTM)

יום שישי, אפריל 23, 2010

At last days many .Net developers upgraded their Visual Studio to RTM 2010. There are some “Known Issues” in this release.After painful upgrade we discovered problem in our WPF project: Some Dynamic Resources from Merged Dictionaries that referenced in App.xaml stopped working (although this code worked without any problems in Beta-2).We found some workaround: Add some style without specific key for unused element in Resource Dictionary and this will trigger WPF to load resources from Merged Dictionaries. Example: <Application x:Class="SomeNamespace.App"              xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">       <Application.Resources>             <ResourceDictionary>                   <ResourceDictionary.MergedDictionaries>                         <ResourceDictionary Source="/SomeNamespace;Component/Styles.xaml"/>                         <ResourceDictionary Source="/SomeNamespace;Component/Brushes.xaml"/>                   </ResourceDictionary.MergedDictionaries>                                 <Style TargetType="{x:Type Line}"/>...

Daily Tip: How to import 3D model to WPF in couple clicks

יום ראשון, מאי 24, 2009

Import 3D Model to WPF from any 3D Editor Many 3D editors can export 3D scenes as OBJ files, these files can be easily imported into WPF project and being used to build complex 3D scenes.See how easy to import 3D scene from 3D editors (for example Blender or 3ds Max): Blender:  3ds Max:  After the export we get two files “scene_objects.obj” (contains definition of scene objects) and “scene_objects.mtl” (contains definition of objects’ materials). Now we can add these files to WPF project: Blend:Open/cerate WPF project and add OBJ and MTL files into objects’ tree.  Open target window, drag and drop added OBJ file...

3D Library for Silverlight

יום שישי, מאי 15, 2009

Silverlight is great technology with powerful graphic capabilities, allows us to build RIAs with animated 2D graphics, scalable controls, media playback, uses GPU acceleration, and much more. The Silverlight application can be developed in same environment as WPF (Blend, Visual Studio, etc), has common principles of design as WPF (XAML, Namespaces, Syntax, etc). But, still it is different and targeted for cross-platform rich-client internet applications, the project from WPF can’t be ported easily to Silverlight (I’ll not open a discussion about why we can’t easily convert projects from WPF to Silverlight). I like both technologies, and mostly the 3D...

Daily Tip: How to import 3D model to WPF from Blender

יום שלישי, מאי 5, 2009

In resumption to my previous post “How to import 3D model to WPF from 3D Max” I want to present the “XAML exporter for Blender” (Blender is an open-source cross-platform 3D designer). if(Blender.Name == Blend.Name) {      Debug.WriteLine(“Wiiiiii !!!! :)”); } This post will guide you how to use this feature thru simple example. Software requirements for this guide: Blender 2.48a or later, Microsoft Expression Blend 2.0 (Final Release). ...

Mouse-Wheel-Helper for Silverlight (upgraded)

יום שישי, אפריל 3, 2009

Recently I’ve required to add Mouse-Wheel support in some of our Silverlight projects. Quickly discovered that unfortunately this feature isn’t supported in built-in events of Silverlight (at least in versions 1.0 and 2.0). After short search I found this post with sample code that solves this problem by attaching handlers to mouse events on html page. I made some changes in “MouseWheelHelper” class and added “UIElementExtender” class that extends classes that derived from “UIElement” class in order to provide Mouse-Wheel support. Here small example that uses “MouseWheelHelper” and “UIElementExtender”:(use mouse wheel to zoom-in/out, also you can change image by pasting new...

Daily Tip: How to import 3D model to WPF from 3D Max

יום שלישי, מרץ 31, 2009

I want to present very useful feature “XAML exporter for 3D Studio Max”. This feature contains number of MAX-Script files with code that allows exporting 3D scenes from 3D Studio Max to XAML files. “Max2Xaml” Project on Codeplex website: http://max2xaml.codeplex.com. I’ll try to present a simple guide for this feature with some useful example. Software requirements for this guide: 3D Studio Max 2007 or later (I use 3D Studio Max 2009), Microsoft Expression Blend 2.0 (Final Release). SDK and Framework requirements: Microsoft .Net...

Small Silverlight Library with RTL (Hebrew) Support (Alpha Ver.)

יום ראשון, דצמבר 14, 2008

(ניתן לראות פוסט זה עם תרגום לעברית) Two weeks ago I've being asked to add a support for Hebrew texts in our last Silverlight project - "Com-Unit", this application is used by sport commentators and provides graphical presentation for real-time basketball statistics. Also displays some sportive "Trivia" about teams and players, this "Trivia" is written in Hebrew. I knew that it will lead to many problems, because MS didn't add (yet) RTL support in any version of Silverlight. In "Ice Age of Silverlight 1.1" (couple months before Justin had published his library) I developed very simple "TextBlockWrapper" with primitive...

UI פוסט 16: כלים לפיתוח תוכנה וממשקי משתמש – MS Expression Studio

יום רביעי, מאי 28, 2008

זהו פוסט המשך לפוסט הקודם, אשר שייך לסדרת הפוסטים בנושא UI . בפוסט זה אציג חבילת כלים MS Expression Studio. לפני שאעבור לכלי פיתוח אני רוצה להציג מבנה כללי של דוט-נט אשר עומדת בבסיס של כלי הפיתוח שאפרט בהמשך: Dot-Net Frameworks: 1.0 - 3.0 כל החבילות הנן בעלות מבנה שכבתי-לוגי הבא: שלש שכבות תחתונות (שכבות הבסיס): - Common Language Runtime - CLR: רכיב של מכונה וירטואלית של דוט-נט. נמצא...