Advice re controls for keyboard app for WP7 - windows-phone-7

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 sort 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.

Related

Page items sliding in in metro style apps

I'm experimenting with creating a metro style app with Visual Studio 2012, I am not the most experienced designer but one thing with my applications is confusing me.
I have been working with 'basic pages' instead of blank ones for the different pages in my application for design consistency, however it seems that these 'basic pages' have a strange behaviour. Every item I place on the page (buttons, text boxes, etc) will all slide in one by one when the page opens. For example if I run the application and navigate to a page with 10 buttons, it will do a brief animation where each button will slide in from the right side to the left side. When dealing with a large number of items on one page this can take a lot of time as each item slides in seperatley.
Looking at the properties for each item I have been able to change the direction it slides in while loading the page by changing the flow direction. Also with a bit of research I am thinking it could potentially be due to either the metro style 'enterPage' or 'enterContent' animations, though I can not be certain.
I have tried to experiment and figure this out, and search to find out what causes this so I can modify it (Ideally I would like to just group items together to slide in with each other) however it's kind of a difficult thing to search with vague words, so I'm asking here.
What is causing this and how might I go about modifying it?
EnterPage shouldn't be sequencing the animations. They do offset some of the animations of a number of elements, but it shouldn't be each one sequentially.
Are you using WinJS navigation?
Well after a bit of experimentation I figured out that putting all my page content inside a grid made them all come in at once like I wanted. I probably should have tried that earlier but everything was already inside an outer grid for the page, so I thought that woulda handled it.
I don't quite understand it fully, but that works for now.

Best way to implement a wizard style UI in WP7

I'm porting a windows forms program to run on Windows Phone 7.
Part of the windows program is a wizard style series of steps with Next and Prev buttons along with Save and Cancel. The screens are generates from metadata stored in a database. Some screens are optional and are only created after certain conditions are met.
My question is - how is this best implemented in WP7?
My initial idea was to use a pivot but then I read Tim Heuer's guide to Panaroma vs Pivot where he specifically states "don’t use pivot/pano for wizard-based UI".
I have a number of ideas - I could make each screen a page (not too keen on this due to back stack issues) or I could use one page with a tab control - but am up against it time wise and can't afford to waste days heading the wrong way.
Any ideas? My WP7 app is being built using MVVM via Caliburn Micro.
I could make each screen a page (not too keen on this due to back stack issues)
The Nonlinear Navigation Service may help you with the back button.
I could use one page with a tab control
I did one wizard-like app in WPF using restyled Tab control. Was a bit messy, works well though.
You need to design it first and consider a few scenarios. What happen when user clicks the back button, starts button or someone calls the user? (when app is tombstoned and user presses back button OS brings back the last page). Is the navigation very complex (decision tree)?
Make just one page with a grid with 3 grids/stack panels inside. Place them horizontally with margins 0; 480; 960. The only one internal grid can be shown at the time. You can see an example here (I made a joke for friends :P ).
I have used stack panels with composite transform.
<StackPanel Name="questionPanel" Grid.Row="0" HorizontalAlignment="Center">
<StackPanel.RenderTransform>
<CompositeTransform TranslateX="480"></CompositeTransform>
</StackPanel.RenderTransform>
with an animation
<UserControl.Resources>
<Storyboard x:Name="centerPanelIn">
<DoubleAnimation Duration="0:0:0.3" BeginTime="0:0:0.6" To="0"
Storyboard.TargetName="centerPanel"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<DoubleAnimation.EasingFunction>
<ExponentialEase Exponent="6.0" EasingMode="EaseOut"></ExponentialEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
When user presses the button, Completed event is added.
private void Button_Click(object sender, RoutedEventArgs e)
{
centerPanelOut.Begin();
centerPanelOut.Completed += new EventHandler(centerPanelOut_Completed);
}
This approach has an advantage, because everything is on one page and animations give the nice UX. For more complex wizard consider making you own UserControl.
My initial thought is to not do this and redesign the process. Without a greater understanding of your situation and app though, it is hard to advise appropriately.
If you're in a hurry and really must do this I'd recommend using a single page and updating the view model to create the appearance of multiple pages.
Alternatively you could use a series of pages and the Non-Linear Navigation Service.
This may have issues with how it integrates with the rest of the application though.
Have you tried using grids and toggling their visibility using a back and next button on the app bar? The back button would then act as a cancel button.

Interactive TextArea (collapsible bullet points)

I don't work with Graphical interfaces very much, most of my experience has been with Java. I realize the operating system provides some "native" controls that allow you to do things. What if I want to do things that are a little more fancy but feel like the native control?
What I'm thinking is having the simplicity of editing in a TextArea while provide the ability to collapse lists just like a tree. I would also like to be able to display text between lines that the user could click, it should be aligned under the right most text and be smaller.
I'm not thinking in terms of any language or GUI library. Just wondering how to go about creating something like this. Would I overlay some drawing onto the TextArea which would scroll with it? Would I use something like Cairo and build my own text field losing built in copy and paste...
What do other text editors use that allow them to fold code?
There is no universal solution to this. It varies depending on GUI. Every GUI has a different way of responding to user events such as mouse clicks, keyboard shortcuts, etc. There is no universal approach to this.

Is there a simple way to combine a text and icon in an NSCell in Cocoa?

I'm trying to create a very simple selection list widget based on NSOutlineView. However, I'm having a hard time figuring out how to display an icon and a label right next to it, which is really the expected behavior in all the mainstream implementations of that kind of widget out there (iTunes, mail, Finder,...).
So far I am just binding two separate cells, but then when I'm expanding the tree, the icon cell grows larger and a gap appears between the icon and its accompanying label. I know I can probably overcome this problem by extending NSCell and provide a custom class, but as what I'm trying to achieve is really the standard thing, I can't be resigned to accept that there isn't a simpler solution.
Candide
Sadly, there isn't a 'text and icon' cell that you can just use, fresh out of the box as you would like. However, when I was working on a project, I found that Apple released some sample code that implements this, since it is such a common idiom.
This can be found here, specifically ImageAndTextCell.h/m
It can help teach you about UI customization by reading through this example, but scratching that, just dropping the ImageAndTextCell straight into your project should do just fine.
You need to create ImageAndTextcell to combine text and icon..
you can create ImageAndTextcell like this Sample Project

windows.form c# moving between forms

I am designing an installer interface for a already written program. It is my first windows.form. I see three approaches to solving my "problem" of needing multiple "screens". I can add all the labels/buttons/interface, and then hide/show them at events. Or I can close and open a new windows? Or do I somehow load my next form into the window frame (sortv like an iFrame approach)? Can somehow help explain how to do this?
Thanks!
Though there is nothing stopping you from using any of the approaches that you mentioned,
using separate windows and opening/closing them would be cleaner. If the code for individual windows gets complicated it would be clearer if they were separate.
Since you said you are doing installer's particulary take a look at Wix. It was meant to be used for creating installer's. It has it's own approach of building UI from XML's.
I would design my "screens" as unique frames with each frame having the controls it needed. Then I would just swap them in and out of the main window.
Its sort of like an IFrame (visually at least).
I agree that WiX is worth a look. An alternative to WiX that some people like more (it's just different, some people like one approach, some like the other) is NSIS.
When I have a requirement that calls for swapping out the controls in a single window, I tend to create a user control for each "page".
Have you considered using The Panel control? You can group certain controls together and have them placed inside one or more Panels.
You could Hide/Show each panel when required.

Resources