FluidMoveBehaviour in Silverlight - silverlight

I'm trying to use FluidMoveBehaviour from the Dynamic Layout and Styles presentation at MIX 2010 in combination with MVVM (Caliburn.Micro).
The Master/Detail behavior is what I'm after. It isn't working and I would like to find out what's happening behind the curtains to see why Silverlight is not picking it up.
How can I debug the FluidMoveBehaviour?

Because the FluidMoveBehavior is so encapsulated and because the source code is not available, the only recourse when it is not working as expected is trial and error. Even worse, the feature is conceptually very opaque and the implications of what will happen if you change the settings are not at all clear initially.
Your best hope of getting the master/detail scenario to work (the most complicated one) is to create a very small example, get it working, and gradually reintroduce your code until it is fully integrated.
There are other working examples besides the MIX10 demo. I recommend reading and re-reading Mike Taulty's explanation until the feature is less opaque:
Blend Bits 14: Fluid Movement
Notice how he approaches the problem gradually and with little test programs. That is how to avoid wasting time trying to use a "black box" feature.
Anyway, the promise of "effortless interactivity" might ring rather hollow right about now. It is perhaps a lesson for other behavior developers: how will the clients debug it when it isn't working? The answer: give them the tools, like configurable logging. When it's not working, the silence is unbearable.

Related

Creating GUI skins - Good or Bad? / Where to begin?

I don't know if it's just me, but I really enjoy some application's GUI designs, apps like iTunes/Avast, or some media players like KMPlayer. So I was thinking of making my GUIs look different and I later found out that it's called a GUI skin (am I right?).
I read somewhere that it's not such a good idea to use or make them regarding app's speed, usability and all that. So the question is: Is it good and safe to make GUI skins? and if so, how could I start programming one (cos I don't want to use off-the-shelf ones unless they're really great). What's the main idea behind them. I am expecting to be able to change the whole form's look and feel and possibly change it's shape.
Any idea on this is greatly appreciated.
Good or Bad?
Bad. I don't have a nuanced answer for you. I don't have a bunch of exceptions. I don't have a thoughtful essay to write on when skins might or not be appropriate. I have an unequivocal: Bad.
Custom skins are the cancer that is killing the Windows UI, turning it into an ugly, unusable jumble of mixed metaphors.
If you must theme because your app is the exception and you're just so cool, please provide an option to turn it off and use the regular OS theme. Not a skinned approximation of Aero, Luna or Classic, but the actual normal OS theme, whatever (potentially custom) theme is chosen.
As far as I am concerned there are two kinds of applications that might be skinnable: Media players for example might benefit from looking like an actual physical appliance (PowerDVD or so did that, iirc). However, the actual use cases for such things are very few, if any – the trend today seems to be that such applications have little to no UI and instead concentrate on the content (VLC is an exception).
Then there is the large host of applications where either developers or managers got creative or too much time on their hands. Raymond Chen calls this “I bet someone got a really nice bonus for that feature.” – a sentiment I deeply agree with. First of all, skins are often a non-feature; the novelty wears off really fast, they don't actually help a user with whatever problem they're having to use your program and finally, for many programs that exhibit skins, there is really no need at all. I mean, come on; how often do you open your AV program, or your graphics card settings panel, revelling in the glory of its beautifully and carefully-designed skin? Never, right.
So then is the question why you even want to devote development resources (either your own or others') to create something that serves no useful purpose, except making your application stand out visually. The windows UX guidelines also have something on window frames and branding. Note here especially the following section:
Don't use custom controls for branding. Rather, use custom controls when necessary to create a special immersive experience or when special functionality is needed.
Incorrect:
This example shows a custom control incorrectly used for branding.
Gadgets are another type of application that can get away with custom designs, but then again, those are often only used shortly and serve generally as either informational things or with ephemeral interaction.
If you do skins, do everyone a favor in making it (a) optional and (b) use the standard controls and just paint them yourself. This enables accessibility tools to still know what your program displays instead of just seeing a bunch of picture boxes that are used as buttons.

Is DxScene the "WPF for Delphi"? Anyone used it?

I am playing with DxScene and VxScene:
http://www.ksdev.com/dxscene/index.html
It looks very nice and powerful: 3d accelerated vector graphics, cross plaform, nice effects, many 2d GUI controls (vector based), good scaling, transparency, rotating (x, y, z), 3d models, etc. Even with many effects, the CPU stays very low (0%)!
http://www.ksdev.com/dxscene/snapshot/screen0.jpeg
But can it be seen as a good WPF alternative for Delphi?
And does anyone use it instead of normal Delphi VCL?
Yes, I am using it now in a new project and intend to use it for all future projects.
It's indeed extremely powerful and versatile. It does consume SVG and even XAML, among many other formats, so you could consider it as a Win32 API WPF alternative. Believe me, I've been looking for one for ages, and this is it for me.
Current drawback: lack of documentation. You have to learn it all from the examples and by asking questions in their forum. Not ideal, but it can only get better!
All it needs is more users, and it'll grow into something wonderful.
I'm not sure, but it looks like it's the GUI base for FlStudio
It looks very promising, the effects are very good, in the past years I have seen it's being enhanced constantly. I have check it the second time today (only the compiled demo), it seems that many new controls are added, I like the "expander" expandable panel.
It's very promising, I'm consider using it in the future, I'm not sure if the new version has fix or not, but when the first time I checked the trial version, it lacks of documentation...
Very good effect and promising though!
You might find this article interesting, it explains how to use the DirectWrite and Direct2D features in Delphi 2010, it seems to be rather simple, and is well explained here: Delphi 2010 DirectWrite "Hello World" Example [1].
Screenshot from the article showing the result.
[1] http://blogs.embarcadero.com/pawelglowacki/2009/12/14/38872

Is there a XAML/WPF/Silverlight style guide?

From .NET Rocks! Show #488:
Richard Campbell: "In the GDI world we
got a document from Microsoft that
said you will build your apps in
battleship gray and here's now they
should look: File goes here and Help
goes here, and we all got that as
developers. There's no book like that
for WPF. There was this idea I've got
to find the guy in a black turtleneck
and here is his piece of software and
you guys go play nice now."
I think Microsoft now wants every Windows application to look like the ugly, difficult-to-use, hardware-bundled crapware we all hate!
Is there no such best-practices document?
There is a Windows User Experience Interaction Guidelines document that Microsoft makes available. It might be along the lines of what you are looking for, but it isn't specifically a WPF or Silverlight best practices guide.
Nobody has paid much attention to MS ui guidelines in a very, very long time (including MS). It is a big part of the reason why every app on windows looks and behaves different from every other app.
Depends on the guidance you're looking for. The primary reason everything was battleship grey in Winforms was less because the Microsoft guide said it should be (it didn't) and more because that was the default and it was a pain to write it differently. Even now, I would imagine that the bulk of the LOB apps written with Silverlight or WPF will use default colors and styles for exactly the same reasons.
But a lot of the other UI guidelines can still apply. If you want something the looks and feels familiar, there's no reason that you can't make a standard menu bar with File, Edit, View, Help, etc. You can still use the same hotkeys, same commands, same layout for buttons and controls.
Keep in mind though that these guidelines were written with assumptions about software and computers in general that are no longer true. The dominant paradigm has changed and people are far more used to websites with different UI layouts and richer visuals. As a result, visual style is a lot more diverse and people are less likely to be confused by some non-standard layouts and controls. Which doesn't mean that anything goes, just that we should feel less contrained to keeping things in the exact same order and position, lest our customers freak out because they can't find the save button.
In short, the style guide was there because there wasn't enough for a real designer to do but still enough that we developers could make things ugly. Now it's even easier to make really ugly stuff, but there's a lot that a real designer can do to make it nice. So hire one. It's worth it.

WinForm custom controls: now or later?

I'm planning to write my first program (it'll be in C#), and I need help with a decision. I know I'll want to use custom controls in the final version of the program (probably these), but someone advised me to use standard WinForm controls until the program is running right. They said once things are running right, then I could replace the UI with the custom controls I want. Is this the best way for me to do it? Or should I use the custom UI controls from the beginning?
About me:
-Never written a program
-Have some light Access/VBA experience and classroom C++ Logic and non-UI programming
-If it matters, I don't know exactly how to do it yet but I do plan to try to keep the logic and the UI as separate as I possibly can. I know that needs to be a priority.
Thanks.
It depends on some factors:
The complexity: a simple custom-draw control can easily replace the standard winform control but generally custom controls add new features and tend to have differents methods and properties. In this case, switching to the custom control is not a simple task.
Your experience: Since you are pretty new to this, using a custom control can add another level of difficulty. Generally, these controls offers more options than the winform controls. So, it would be wise to start with the simple winform controls.
Since this is your first project, I tend to agree with your friend. While there is nothing inherently wrong with starting with third party controls, you will find that there is much more documentation and help available for the built in controls. In your early development efforts, you will likely hit many stumbling blocks, regardless of the choices that you make. Therefore, starting out with the most well-travelled course may make things easier for you starting out.
Once you have a little more experience debugging some of the issues that you will inevitably experience while learning a GUI framework, then it would make more sense to start bringing in glitzy third party controls.
Just use the standard controls. Keep it simple, Keep it simple, keep it simple. Also know that if you are still programming next year (hopefully on other projects), you will look back at this code in shame -- but that is a good thing.
Never written a program? I would not advise using any third party libs at this point, you are still learning. If you want the benefit of custom controls, why not write them yourself? You get the custom behavior and you actually learn how this stuff works.
Also, this statement is a bit of a red flag:
-If it matters, I don't know exactly how to do it yet but I do plan to try to keep the logic and the UI as separate as I possibly can. I know that needs to be a priority.
Design patterns are great, but until you get some experience it is hard to understand why they are so great. Start like everyone else writing 'bad' code and then come back to the design patterns. That way you will truly realize why they are so important (rather than just being told that they are). Don't try to grok the advanced stuff before being full competent with the fundamentals.

Designers and developers working together [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
The rich presentational capabilities of WPF and Silverlight mean developers like me will be working closely with graphic designers more often these days, as is the case in my next project.
Does anyone out there have any tips and experience (from both points of view) on making this go more smoothly?
For example, when I mentioned source control to a designer recently, I was quickly told you can't source control graphics, images etc, so it is a waste of time. So I responded: ok but, what about XAML files in WPF/Silverlight?
Scott Hanselman spoke about this topic in a podcast, but he focused more on the tools, while I'm more interested in the communication issues/aspects.
One of the things I've discovered is that how you as a developer design your code greatly affects what the designer can do with it. Often you download a Silverlight or WPF sample application from the web and open it up in Blend, just to have Blend crash on you because the code doesn't run well inside the designer. If it doesn't crash, it seldom look anything like the running application.
I recently gave a talk at Tech Ed Australia and New Zealand about techniques you can apply to "design for designability". A short bulled list is included:
Write code that can take advantage of data binding. The Model-View-ViewModel or the presentation pattern is a good fit for this.
Supply "design time" stubs for your service dependencies. If the class you are binding against makes web service calls be sure to replace the web service client with a stub class that returns "dummy data" that the designer consumes inside blend. This can easily be done through IoC and Dependency Injection, injecting one implementation if HtmlPage.IsEnabled == false.
By using data binding you can limit the number of "named elements" you have in your XAML file. If you write allot of code behind you end up coupling your C# code against named elements such as txtName or txtAddress, making it easy for the designer to "screw up".
Use a command pattern instead of code behind click event handlers. By loosely couple the invoker of an event from the handler you can have less named elements, and you give the designer the freedom to choose between a Button or a Menu Item to invoke a specific command.
Test your code in Blend! Even if you consider your self a pure developer you should test that your code is consumable by a tool, and strive to get a best possible experience at design time. Some would argue that a tool shouldn't effect your software design, just as some one complains about "design for testability", and making software design decisions just to make the code more testable. I think it's a smart thing to do, and the only way you can get some real designer-developer work flow going.
Other tips would be to start small. If your designer is new to XAML, WPF and Silverlight, start by introducing them to the project team, and have them do some basic designs in the tools they know. Let them do some buttons and illustrations in Adobe Illustrator, and export it to XAML, and show them how you can leverage their design assets directly. Continue by introducing more and more, and hopefully they get interested and want to make the switch to Blend. It's quite a learning curve, but it sure is worth it!
Good luck!
PS: I have written allot about patterns and making designer friendly code on my blog at http://jonas.follesoe.no. You can also find links to a video recording of my Tech Ed talk, as well as lots of links to further reading on the topic.
I have spent 4 months on a project working extremely closely with a designer and he has still not picked up the basic idea of CVS (which is not my choice of source control system). I'm talking template files, JavaScript and CSS here. He's not stupid, it's just one of these things that makes his job harder so he resists fully commiting himself to it.
In my case I had to really hammer home the point that almost all of my JavaScript depended on the mark-up and when he changed his pure CSS, DIV-based layout into a table-based one without telling me then all my JS is going to break.
Often during the course of the project myself and the designer, who I get on with quite well and play soccer with outside of work, had very heated exchanges about our respective responsibilities. If I didn't know him well enough to just get past these exchanges then I think it would have created an unbearable working environment. So I think it's important you establish between you both and with some sort of manager or project supervisor exactly what is expected of both parties during the project.
In my case there have been very few problems lately, because the situation with CVS has been sorted out as well as the idea that he can't just go and change the mark-up whenever he feels like it. Rather than try and create template files and work on them directly, the designer only works on static files and its my responsibility to plug them into my template files.
It's all about communication and a little bit of compromise on both sides.
This may be a bit off topic (I'm replying specifically to your question about source control and graphics), but you can put binary data (images etc.) into source control (and in my opinion in a lot of cases should) -- they just take up more disk space and you can't use a diff view to analyze what has changed in any meaningful way, but what you do gain is a history of commit messages documenting each revision, rollback ability and the ability to easily archive (tagging a revision in SVN terms) all files (be they visual assets, documentation, source code, whatever) belonging to a specific release/version together. It's also easier for your build system to just fetch everything required for building a specific version of your software from the source control.
Involve the graphic designer in early design and architecture sessions.
You want to involve them to reveal misaligned assumptions and to establish a pattern of working together rather than throwing things back and forth over the wall.
Originally, it was envisioned that professional designers would work in Expression Blend, and developers would work in Visual Studio, making changes to a single shared set of source files. While it is certainly possible to do that (so long as you are careful to check regularly that you haven't broken something expected by the other dev. or design tool), many members of the developer community, including some inside Microsoft, have discovered benefits in keeping Blend and Visual Studio project activity SEPARATE -- even to the point of manually cutting and pasting carefully-refactored versions of Blend-generated Xaml into the "official" VStudio project source, rather than allowing designers and developers operate directly on a single shared code base. Microsoft's User Experience Team in the UK published a video describing the problems they ran into trying to coordinate designer and developer efforts on actual projects.
Real_World_WPF_DesignersAndDevelopersWorkingTogether
One of the main lessons learned is that you can't staff a project with designers and developers who are completely ignorant of each other's domains. Developers need to be familiar enough with Blend that they can provide designers with useful UI shells for the designer to decorate, and useful data "stubs" the designer can design interactivity against, and the designer needs to have enough understanding of development issues that they don't do things like delete controls and replace them with custom visual elements - not realizing that they broke all the functionality tied to the original control.
Microsoft's vision of the designer/developer workflow marriage definitely seems to break down in real life. I have experience working on a fairly large scale WPF project which involved 2 dedicated design resources for about 4 months. Here are some facts that Microsoft seems to often forget.
Designers often prefer to use Macs (designers at my company are 100% Mac - 0% Windows)
Blend doesn't run on a Mac (as far as VM solutions - designers typically don't like geeky solutions like running weird applications in a foreign OS).
Designers use their tools of the trade - Photoshop and Illustrator. Period.
The aggressiveness of today's schedules usually don't provide ample time for designers to learn a totally new application / design environment (like Blend).
So given the above, what I noticed was that this creates a new job type - either a very techy designer or a graphically enlightened programmer. Basically, someone who can take the design assets in raw form - usually .psd or illustrator format and apply these as needed to the application process.
I turned out to be that guy (graphically enlightened programmer). I spent a lot of time exporting XAML from Illustrator files, cleaning them up by hand when necessary, and making these assets easily usable display objects in Blend or VS. There were also times where I would take a a design element and re-draw it using blend ( usually when the original asset was bitmap based and it made more sense to convert it to vector).
My application may not have been typical - as it was extremely graphically rich and resolution independence was one of the main objectives as it needed to look good on multiple resolutions and aspect ratios (think of the difficulties in designing for TV in todays landscape - things have to look good in both low-res SD and scale well up to hi-res HD).
In summary, I think WPF is an awesome technology and absolutely a step in the right direction for Microsoft. It however is not the end-all be-all solution for integrating the designer in the development process - unless you redefine the role of designer.
I'm Felix Corke, the designer from the hanselman podcast you mentioned, so here are a couple of points from a genuine creative as opposed to a developer.
It took a long time to become used to developer tools - I'd never heard of Visual Studio, C# or any type of source control when I first started doing xaml work a few years ago. They were as alien to me as maybe Illustrator or 3DsMax would be to you.
My biggest single point is that the designer can't be expected to know developer practices - please be prepared to do a great deal of hand-holding. You won't have to learn anything new whereas the designer will be launched into a whole new scary side of app development. I made a right mess of a few solutions and checkins (and still do).
Happily, I've learned to become more of an design focussed integrator than a straight creative, and maybe this is a role you need to include in your project. This is the illustration I made for our beauty and the geek - designer/developer session at Mix - if either of you is at too far at either end of the spectrum it can be difficult understand how the other works and what their role should be.
Happy to answer any specific questions!
ps you do NOT want 100Mb+ .psd files in source control ;)
The extent to which designers have come to feel entitled to be distant from the whole of the work involved in building a software product is a much bigger problem that needs to be solved. Don't pander to any designer's expressed right to not have to know how their work gets integrated into the whole.
The kind of stark specialization that has grown up in the designer community is one of the biggest industrial maturity problems that faces the software development industry. It's an extent of specialization that predictably creates more rework and longer cycle times.
This is also true of developers' sense of entitlement to go blissfully unaware of interaction design and implementation.
Extreme specialization is always an exponential multiplier in productivity problems. Solve it organizationally by adopting processes that promote learning cultures. This is the level of maturity that most other production industries have already realized, and that software drags woefully behind.
At every place in a development workflow where handoffs occur between over-specialization, work queues and buffers form. Software remains one of the few industries that doesn't recognize this as one of the biggest problems we face. This is even more exacerbated in the Microsoft community as over-specialization seems ever-more normal due to Microsoft's perpetuation of over-specialization through its tools and guidance. Unless you can afford to waste as much money as Microsoft does in development efforts, you should look to methodologies that are much better informed on questions of flow and productivity.
Consequently, the developer who cannot test and the tester who cannot code is a symptom of the same industrial immaturity.
You won't learn any of this from the Scrum template for TFS. Microsoft was years behind the curve in getting agile thinking in-play even in its most rudimentary forms, and now that we're progressing into Lean thinking, Microsoft will be another three to five years away from trying to incorporate Lean thinking into its product lines. Don't wait for Microsoft to tell you how to shape a team and a workflow. You can learn right now from the people that Microsoft will ultimately pay attention to in a few years.
I'm a big believer in the Integrator approach which is really the role I have had to perform to make our WPF efforts successful.
Laurent Bugnion has a post on this that describes what I'm talking about. Robby Ingebretsen is also a big believer in this approach.
But basically, someone has to cover the 'gap' that exists between the developer world and designer world. What usually happens is that this person comes from either the developer world or the designer world. If they come from the developer world, then they are probably a developer with designer tendencies (they're responsible for look and feel, the visuals in the application, the layout of the screens, etc.). If they come from the designer world, then they aren't afraid of code and the enjoy diving down every now and then to code to get that animation or whatever sparkling.
However, regardless of what world they come from, they usually have to build skills that they never have had before. In my case, I am developer that loves the user interface layer and therefore I would say that I am a developer with designer tendencies. In order to cover that gap and have productive conversations with our graphics designer, I have had to pick up a whole bunch of designer type skills like: learning to use Expression Design, XAM 3D, etc.
Shannon Braun recently gave a presentation at a local developer conference about the developer/designer relationship and the workflows that the community is discovering works for them. I didn't attend the conference, but I thought his slides were a great discussion on the matter.
In my experience, the integrator or "devsigner" role really needs to be involved in this process unless everyone on the (small) team are able to perform this role. This is a very rare circumstance. Usually you will find that developers are very good at developing but aren't so great with design/usability and designers are great with aesthetics/usability but don't want to or are not educated enough to code. Having someone that can crossover into both worlds and "speak the language" is very important.
The integrator needs to coordinate the controls that are being developed with the design assets that are being created by the designers. In our current project, we have 6 active developers and 2 designers from an outside shop. I am the integrator for this project and I spend most of my day in Expression Blend. The developers work primarily in VS creating controls that meet our product spec and the design shop is designing what the end product will look like. The designers are working in Illustrator. My job is to take the Illustrator files and create control styles from them and then apply them to the controls developed by our development team. As we move towards Blend 3 with native support for PSD and AI files, this task becomes much easier.
It is very helpful to create the "look" for your application in a separate solution from the main trunk of the application and then merge your ResourceDictionaries into the main app later. You can get the look and feel correct without getting too caught up in what could still be incomplete controls.
I am going to assume that you refer to RIA projects since your mention of SL.
I have worked one quite a few RIA projects with Adobe designing and developing applications and services.
The best advice I can give you based on based on my 14 years experience as an UX and Visual designer with some programming experience although pathetic compared to you guys.
Accept that you wont understand each other.
The programmer thinks in what functionality should be done, the designer think in how the functionality should behave.
For the developer a button is mostly generic, for the designer it's not the case. Designers think in composition, developers think in frameworks.
So learn to understand that your responsibility is different.
You the developer DO need to think about how generic your code is and can't afford to treat everything as being unique and a hardcoded composition. That is unless you can automate that uniqueness somehow.
The designer DO need to think about the application or service as somehow unique. It might mean that a button is not a button. There might be different sizes or colors or other annoyances.
So make sure you develop a good relationship with the designer by acknowledging that you understand the designers responsibility and make sure he understands yours.
It's not that you are not interested in making the best application in the world. It's just that some of these design decisions takes quite a lot of time.
Make sure that you get very clear on how the designer should deliver to you so you don't waste his or your own time. What format, assets? Naming?
All things that are involved in delivery from one paradigme to another.
And most importantly communicate and respect that they don't know how to do JavaScript or how understand the basic ideas of CVS.
Most developers you wouldn't know how to kern to save their life, what a widow is, how to best layer FireWorks or create a photo-realistic icon, come up with a good tagline or make something understandable to average Joe in 4 words. You don't know what a grid or alignment is and you tend to make things green and purple on black.
And the designer should understand that just because you deal with programming does not mean you are a robot, that you can't have creative ideas and solutions. He should also try to learn how to program at least pseudo program so that he understands what's involved in making your project.
And most importantly. Don't start to debate Mac vs. PC :) Projects have been canceled because of this.
Quite frankly you should tell the designer that images can, should and "will be put in source control mister!" :)
It may be slightly non-conventional and you wont be able to do a merge or anything of that nature, but there will be revisions and a history, etc .. Images can also be embedded in a resource file which goes into source control as well.
XAML can (and should) be put in source control and as its a markup file it will benefit from all of the features.
As far as tips from working with a designer, the one you are working with scares the heck outta me just by that comment alone, so it may all boil down to WHO you are working with. I would explain basic best practices in a nice manner and proceed from there.

Resources