Advice re controls for keyboard app for WP7
I am looking to develop a keyboard app for WP7. My son has done a pretty good one for ios and I would like to do the same under wp7. I have a programming background but not in c# /Silverlight so seeing this as a chance to learn with a decent sort of project.
What I a struggling with is what controls I should use for this -even for starters i.e Stack Panel, Grid etc or whether I should be building a custom control. I haven't been near expression blend at all.
Really struggling with getting my head around the controls that I should be building this so开发者_JAVA技巧rt of thing with.
any advice appreciated.
Thanks .
As a general answer to this, I'd say that this sounds like a great first project - you'll soon get the hang of Silverlight and master these initial problems - just get in there and start coding.
To work out how these different containers work:
- I like this set of simple explanations - http://wpf.nickthuesen.com/?page_id=33
- try working through some sample apps - e.g. take a look at a blog like http://sigurdsnorteland.wordpress.com/ - his projects use Grids, Canvases, etc and are often all in one cs/xaml file - so easy to get to grips with.
By keyboard, do you mean "music" or "typing"?
Assuming "typing" then take a look at how this works - http://wpkeyboard.codeplex.com/
Assuming, music, then take a look at:
- a simple piano - http://script.iron7.com/#/Script/Detail?scriptId=91287aa96ca74892b96171313c9b5ea2&userLowerCaseName=stuart
- a simple xylophone - http://script.iron7.com/#/Script/Detail?scriptId=6db87d269f3e4f18834bcece0e13fb8d&userLowerCaseName=stuart
Both of these use a set of buttons within a StackPanel.
For more advanced layout - e.g. for a keyboard that includes those black notes as well as the white ones, then you can look at using a Grid or a Canvas
Sorry - just looked some more - the music samples above are in ruby and contain some animation for when each key is pressed, so they might not be that easy for you to follow - but the basic idea is that those apps use very simple layout like:
<StackPanel>
<Button />
<Button />
<Button />
<Button />
<Button />
<Button />
</StackPanel>
One thing to bear in mind is that you can design several sets of layout independently of your app logic - so you can start with something simple/ugly and then make it more advanced/beautiful by changing only the xaml.
The display of the SIP is handled by the operating system and will always be on top of the visual tree of any application. If you want to provide a custom SIP, you will need to provide an alternative input control, because the display of the native SIP is tied to input controls (such as TextBox
, PasswordBox
, etc.). You may find this article about creating a Bulgarian keyboard useful.
In terms of actually layout out the keyboard, I'd probably go for a Grid-based layout, which gives you the flexibility to span multiple columns to make individual keys larger.
精彩评论