So I introduced Kanban, the project management process we are using at work, to to my wife and she is going to try it out for her managing the tasks for her blog.
Of course, being a craft blogger, she made a craft project out of the idea for making a Kanban board. Check out her version of a Kanban board.
The main reason my XBox is collecting dust is, besides the fact that I haven’t bought my wife Dance, Dance Revolution, is because there isn’t a game that is enticing me to play it when I get home from work.
I want to play something like Metroid, and jump around and shoot friekazoid alien creatures. I don’t care if I have to combine some type of controller or gun-like device with the Kinect. Or I want to play Madden 2011 and just run over the computer team for 300 yards or bomb passes all games 7 touchdowns.
I just want to have fun and really, the Kinect just isn’t providing me the fun.
It makes a difference if you do something the right way from the beginning. Everything seems to work out so much better and takes less time over all.
Here are some basic steps that I have learned will help you do it right the first time. These steps are from my experience, mostly because I did it wrong the first few times. These are not exact steps. They are subject to change and improve. In fact, you might have improvements to suggest immediately when you read this. But if you are new to WPF, then reading these steps before you start and following them, will have you closer it doing it the right way the first time. It is much more pleasant to tweak a pretty good process than it is to go in with no idea for a process and do it wrong.
Step 1 – Prepare the idea
Some one has an idea
Determine the minimal features for release 1.
Determine the minimal features for release 2.
Alter minimal features for release 1 if it makes sense to do so.
Determine the minimal features for release 3.
Alter minimal features for release 1 and 2 if it makes sense to do so.
Step 2 – Design the Application’s back end business logic (simultaneous to Step 3)
Design the backend
Apply the “Keep it simple” idea to the business logic and makes changes as necessary.
Apply the “Keep it secure” idea to the business logic and makes changes as necessary.
Repeats steps 2 and 3 if necessary.
Backend development can start now as the UI and the back end should not need to know about each other, though this coding is listed as the Step 5 item.
Step 3 – Design the UI using WPF (simultaneous to Step 2)
Determine what development model should be used to separate the UI from the business logic.
Model-View-ViewModel (MVVM) is the model I recommend for WPF.
Gather libraries used for the model (such as common MVVM libraries that include the common ViewModelBase and RelayCommand objects)
Consider using a 3rd party WPF control set will be used. Many 3rd party companies provide WPF controls that are better and easier to use than those included by default.
If you decided to use 3rd party controls, purchase or otherwise obtain the libraries for these 3rd party controls.
Consider designing two WPF interfaces or skins (I will call these Views from here on out) for each screen. This will help drive the separation of the back end code from the WPF code. Also if developing two Views is not simple, it indicates a poor design.
Design the interface(s) (you may be doing two Views) using SketchFlow (take time to include the libraries for the 3rd party WPF Controls in your SketchFlow project and design with them)
SketchFlow allows you to design the UI, which is commonly done in paint, but instead does this in XAML, and is actually the WPF code your application will use.
SketchFlow allows you to deliver the design (or both Views if you did two) as a package to the customer.
Deliver it immediately and get feedback.
Make changes suggested by the customer if in scope.
Take time to make the XAML in SketchFlow production ready.
Deliver the XAML to the customer again, to buy of that the design changes are proper.
Make changes suggested by the customer if in scope.
Step 4 – Determine the delivery or install method
Determine the delivery method.
Determine when to develop the delivery method.
The easier the application is, the longer you can wait to determine the installer or delivery method.
The more complex the install or delivery method, the sooner this should be started.
Step 5 – Develop the business logic
Develop the application designed in step 2.
Get the application working without UI or silently. Note: Start the next step, Develop the UI, as soon as enough code is available here.
Step 6 – Add Bindings to the UI
Start the UI project by copying the XAML from the SketchFlow document to your Visual Studio or Expression Blend project.
Determine a method for setting the DataContext without linking the View to any ViewModel or Model dlls.
Create a project for the ViewModel code and develop it to interact with the business logic using Binding.
Remember to develop two Views for every UI screen as this will help, though not guarantee, that the the MVVM model was correctly used.
Step 7 – Develop the View Model
You should now have a backend code and a View, and now you start creating the View Model.
This should be in a separate dll than the View or ViewModel.
The ViewModel should never link to the View but can link to Model and Business libraries, though you may consider interface-based design and only link to an interface library.
Make sure to use the properties that the View is binding to.
Step 8 – Consider a other platforms
Macintosh
Macintosh owns a significant market share. Determine if this application needs to run on Macintosh as well. Sure, since we are running C# your options are limited to either rewriting in objective C and Coca, or using Mono with a MonoMac UI. I recommend the latter.
Note: It is critical that the UI and business logic are separated to really make this successful.
Completely ignore the WPF design and have Macintosh users users assist the design team in designing the new UI. Macintosh’s have a different feel, and trying to convert the same UI is a mistake.
Create the MonoMac UI project.
Create a project similar to the ViewModel project in Windows, to link the UI to the business logic.
BSD/Linux/Unix
BLU (BSD/Linux/Unix) doesn’t exactly own a significant market share. However, it is still important to determine if this application needs to run on on BLU as well. Sure, since we are running C# your options are limited to either rewriting in C++, or using Mono with a GTK# or Forms UI.
Completely ignore the WPF and Macintosh designs and have Linux users assist the design team in designing the new UI. Linux have a different feel, and trying to convert the same UI is a mistake.
Create the GTK# project.
Create a project similar to the ViewModel project in Windows, to link the UI to the business logic.
GTK# doesn’t support binding, but still keep the UI separate from the business logic as much as possible.
Also, don’t develop for a single open source flavor, but use standard code that compiles and any BSD/Linux/Unix platform.
Mobile Platforms
Do you need to have this app on IOS or Android or Windows Phone?
Completely ignore the WPF and Macintosh and Linux designs and have Android or IOS users assist the design team in designing the new UI. Mobile platforms have a different feel, and trying to convert the same UI is impossible as the screens are much smaller.
Step 9 – Develop the delivery method
Again, you may need to do this way sooner if the application is complex.
Develop the install or delivery method.
If you decided to deploy to Macintosh or BLU you may have to develop separate install or delivery methods for those platforms as well.
Remember to have a plan and a test for your first patch even if you have to mock a sample patch before you release.
Remember to have a plan and a test for upgrading your application even if you have to mock a sample upgrade version before you release.
Step 10 – Deliver the finished Products
Once finished, deliver this product.
If you decided to create a Macintosh or BLU version, deliver them when ready as well. It is OK and maybe preferred to deliver these at different times.
Today I had to solve a problem that appeared quite difficult, but turned out to not be so hard if I let Expression Blend do most the work and finish it up in the XAML. I ended up having to completely recreate the default template style and then modify it.
Note: This article could also be titled: How to change the default template style of a standard control?
I had a RadioButton with text that wraps and it wasn’t displaying exactly how my team wanted. Here is the XAML.
<Window x:Class="RadioButtonTopAligned.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<RadioButton GroupName="RadioButtonList">
<Label>
<AccessText TextWrapping="Wrap" Text="_This is a very long radio button control line of text that should wrap." MaxWidth="300"/>
</Label>
</RadioButton>
</Grid>
</Window>
The problem is that the circle bullet is center aligned like this:
Notice how the circle bullet is aligned in between the two lines of text. I need it to be top aligned like this:
Notice how the circle bullet is aligned with the top line of text. I need to get WPF to do this.
From a Visual Studio 2010 point of view, there is no easy way to do this. At first I thought it would be a simple dependency property, but it isn’t. An quick internet search led me to realize that I have to pretty much re-style the whole RadioButton. This sounds really hard and in fact, in Visual Studio, without help, it would be really hard. You would have to have the code for the default template style for the RadioButton control memorized.
While the post is exactly what I was looking for and has an answer, I didn’t at first grasp the answer. I wasn’t sure what was going on until one of my co-workers, Shawn, who is more skilled in Expression Blend, showed me. Now that I understand, I want to make sure the next person who finds the same forum post on MSDN can understand even easier by writing this article and adding it to the forum post.
This is where Expression Blend comes in. If you don’t have Expression Blend, don’t worry, you can still get through this article as I will include the the default style code that Expression Blend created for me right here in my post.
In Expression Blend, this is what to do.
Create a blank WPF project in Expression Blend.
Add a RadioButton.
Right-click on the RadioButton and choose Edit Template | Edit a Copy…
Click OK on the Create Style Resource window.
Here is what happens to your XAML and you can do this to the XAML in you project manually if you don’t have Expression Blend.
The following reference is added to the project: PresentationFramework.Aero
The same is referenced in the XAML (See line 4 of the XAML below)
The default RadioButton style is copied to your XAML under the Window.Resources element. (See lines 10-48 in the XAML below)
The RadioButton is assigned the style created. (See line 51 in the XAML below)
Now we can edit the XAML. Below is the same XAML as above with the following edits:
Inside the BulletDecorator.Bullet element on line 30, create a DockPanel around the BulletChrome element.
The ControlPresenter is moved to be inside the DockPanel.
Add the following XAML atrributes to the BulletChrome element:
VerticalAlignment=”Top” Margin=”0,8,0,0″ Height=”{TemplateBinding FontSize}” Width=”{TemplateBinding FontSize}”
Note: If you change the font of the text content in the RadioButton, you should change the Margin in the style as well. I haven’t figured out how to make it always match the top line without manually tweaking it when you change the font. Also, if you don’t want the BulletChrome element to be the same size as the font, you will have to tweak Width and Height too.
I hope this posts clarifies how to completely recreate a template style for a default control to modify something that at first doesn’t appear modifiable.
It mentions that the top three languages today are Java, C#, PHP.
Then it talks about the languages on the rise:
Python
Ruby
MATLAB
JavaScript
R
ERLang
Cobol
CUDO Extensions
Note: No, that is not a mistake, they list 8 languages even though the title of the article says 7.
While they gloss over the Java, C#, and PHP languages, the article implies that these are the top languages used today.
What they missed in the article (besides being unable to count) is:
That development itself is on the rise. The lesser known languages are easier to learn any one language as every language now has serviceable documentation online, so we are limited to the languages that descent books were written about.
What I read from this article is:
If you really want job security stay with Java, C#, and PHP because they are the top three programming languages. Sure it is nice that others are on the rise. But who wants to limit themselves to 2% of the development jobs available.
I have recently started reading an e-book from PACKT Publishing.
With the internet and internet-based offering being renamed to “The Cloud” which is just a fancy buzz word marketing came up with that they don’t even themselves know what it means, understanding web services, which is mostly what “The Cloud” will be based on is going to be key in a developer’s job security.
Being able to provide a cloud offering without licensing costs because you are using free software such as Apache, is nice too.
I am writing this post to you from a Motorola Xoom.
Typing is definitely harder than with a keyboard yet much easier than from a phone.
It didn’t work out of the box. Apps wouldn’t download, and Google talk wouldn’t connect. I finally factory reset it and started over and it worked. We think you have to log in during the initial configuration to avoid this issue, but we didn’t try to dupe it.
I am using three things that are just not friends:
Pages and NavigationService
Model-View-ViewModel design
The PasswordBox control
Problem 1 – PasswordBox.Password is not a DependencyProperty
First off, Model-View-ViewModel is design centered around data binding. But PasswordBox.Password is not a DependencyProperty and therefore does not support binding. That is ok, a PasswordBoxAssistant (alternately I have seen it named PasswordHelper or PasswordBoxHelper) as described originally here and also here fixes seems to fix this.
That is, it fixes it unless you are using the NavigationService.
Problem 2 – NavigationService blanks PasswordBox.Password
See when the NavigationService navigates to another page, it somehow know that the current page has a PasswordBox and if it finds a PasswordBox, it blanks the password out. So since we are using PasswordBoxHelper to make MVVM and data binding work, the value is blanked in the ViewModel and Model as well.
For now, I happen to be using a custom button for navigation so I can simply do this in my ViewModel:
However, this is not the best solution. What if there were multiple links and different ways to navigate?
I think the best solution would be to figure out how to make PasswordBoxAssistant handle this. But I am not sure how or if there is anyway to tell that the password was blanked by the NavigationService and to ignore binding in this instance.
I am working on a project at work that is a navigation application.
I wanted to use MVVM. I also wanted to document for others how I designed this, as there wasn’t much online about using MVVM with Navigation and Pages.
Here is my project. I will post an explanation of this project as soon as I can get to it, so look for it.
I was the 200th person to like the FreeBSD Foundation Facebook page.
The FreeBSD Foundation helps collect donations and fund projects to improve FreeBSD.
If you have the ability to contribute, you should. I realized I hadn’t contributed since last year, so I went ahead and donate a meager sum this year. http://www.freebsdfoundation.org/donate
The FreeBSD needs a lot more than 200 people liking it and a lot more people donating.
This is a terrible email to get. Do I believe them that the passwords weren’t nabbed as well? No, I don’t. So I have to change every site that uses this same password.
How annoying!
TiVo® Service Announcement
Dear TiVo Customer,
Today we were informed by our email service provider that your email address was exposed due to unauthorized access of their system. Our email service provider deploys emails on our behalf to customers who have opted into email-based communications from us.
We were advised by our email service provider that the information that was obtained was limited to first name and/or email addresses only. Your service and any other personally identifiable information were not at risk and remain secure.
Please note, it is possible you may receive spam email messages as a result. We want to urge you to be cautious when opening links or attachments from unknown third parties.
We regret this has taken place and apologize for any inconvenience this may have caused you. We take your privacy very seriously, and we will continue to work diligently to protect your personal information.
If you have unsubscribed in the past, there is no need to unsubscribe again. Your preferences will remain in place.