Migrate the Jetpack theme from Silverlight to WPF
14 October 2010There is a great theme named Jetpack available for Silverlight applications which can be found on the Tim Heuer web site. I was wondering if it can be used in WPF applications and the answer is yes ! Here are the modifications I had to do to make all this work :
- SelectionBackground replace by SelectionBrush (except for the DatePicker)
- I removed the HyperlinkButton which does not exist in WPF
DataGridFrozenGrid is not existing in WPF : I replaced it by a GRID - No navigation system : Frame style removed,
- No page : replaced by HeaderedContentControl
- DescriptionViewer : not available in WPF and removed,
- TabNavigation replaced by : KeyboardNavigation.ControlTabNavigation
- ValidationSummary does not exist in WPF : I removed it,
- No Watermark in WPF: I removed it
- ContentPresenter does not support direct content : Ireplaced it by ContentControl,
- AutoCompleteBox : not available in WPF and removed,
- DataPager : not available in WPF and removed,
- ChildWindow : not available in WPF and removed,
- I removed the style targeting the textblock because it was imposing itself anywhere especially in the listboxitem leadind to wong behaviours,
- I replace the differents name by their WPF PART_XXX counterparts
- PasswordBox : Ireplaced the ContentElement border by a ScrollViews named PART_ContentHost
- I Replaced the animations key <DiscreteObjectKeyFrame KeyTime="0" Value=”Visible" /> by <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
- Rewrite entirely the scrollbar style so it works nicely...
- Rewrite entirely the Slider style so it works nicely...
- Rewrite a fex the TabItem/Tab control style so it works nicely...
So far, here is a list of the translated control’s theming :
- TextBox,
- ListBox,
- Combobox,
- PasswordBox,
- ProgressBar,
- Button,
- ToggleButton,
- RadioButton
- Checkbox,
- Scrollbar,
- ScrollViewer,
- Slider,
- TreeView,
- TabControl,
- Label
So far, here is a list of the NOT TESTED and may not working element
- Datagrid,
- DatePicker,
- Grid Splitter,
- Expander,
- ContextMenu.
PS: the demo application is in the post attachment…
I am currently working on it to add more working them components.
Edit (16/10/2010, 01:28) : I added new controls themes(Scrollbar, ScrollViewer, Slider, TreeView, TabControl, Label) and a new demo applications.
- By JonathanANTOINE@falsemail.com
- - WPF
- - Tags :
Comments
very cool. Thanks.
Good work, you saved me a ton of work!
Thanks!!!
Very beautifull.
Will you continue to migrate all the controls?
@seifer3x: I'll for sure, i am just running out of time at this moment :-)
thx for your work!
I found this :
http://live.mscommunity.net/blogs/b...
and also:
I have a probleme with the ListBox and DisplayMemberPath. They didn't work in my solutions.
I fix the probleme like this:
Replaced line 1647-1651 of Assets/CoreStyles.xaml (in ListBoxItem Template)
by
maybe that's will interested someone but I'm not sure that the best way.
@guth William : Thx for the comment, I will correct it ASAP
Hello, this is excellent and very useful, thank you.
Did you ever get round to migrating the DataGrid or DatePicker controls as well?
Thanks
Sam
Hello Jonathan,
Thanks for converting this style I was actually doing this myself last night then found your blog and it saved me the trouble. However I am having a few issues with your conversion.
ProgressBars set to IsIndeterminate cause the editor to error saying:
Cannot resolve all property references in the property path '(0).(1).(2)[ 0 ].X'.
Which is on line 1448 of CoreStyles.xaml
Another issue I found was with TabItems, Which is throwing this error:
System.Windows.Media.Animation.ColorAnimationUsingKeyFrames' animation object cannot be used to animate property 'Foreground' because it is of incompatible type 'System.Windows.Media.Brush'.
Which is on line 3013 of SDKStyles.xaml.
I'm using Visual Studio 2010 with all the latest updates and such, along with the Windows Phone toolkit installed. I'm fairly new to WPF so figuring out how to fix these issues alone is proving troublesome. Any help would be greatly appreciated.
On a side note, the application will still run when compiled, it just wont show in the designer due to these errors.
Thanks,
CK
Hey!
There's a problem with the tabcontrol.. It says:
System.Reflection.TargetInvocationException
Exception has been thrown by the target of an invocation.
Thank you!
Johnathan, excellent! This is a great contribution indeed and saves us the conversion effort. I am happy.
Many thanks!
@Fredrik : I will do my best to fix it as soon as possible !
@alessandro : Thank you, you are welcome
@CK : Hey, I updated the project on codeplex, it should be working now
Hi again!
Couldn't you complete this UI? I'd need the expander, but it doesn't work - any ideas?
/ Fredrik
@Fredrik Duwell : Hey, the Expander can't be migrated because it does not have the same property thant the SL's one. You may try using the one is the amazingWPFControls codeplex project...
Isn't there any other way to make it work? I've been trying to make it expand, but when I click on the expander the arrow toggles, but the content doesn't show up!