3

I am designing a windows phone 8 app. In this app I am recording a video and after recording completion ask the user for the file name to be saved, and then save the file in isolated storage with given name.

I have a separate videorecorder.xaml page developed for that.

Can I take user input by showing a modal dialog like thing over the videorecorder.xaml page and return that data to parent page?

If so, how can I do that?

I tried ToastPrompt from Coding4fun but it does not take user input. It just shows a message.

Is there any other elegant way to ask filename before saving file from user?

Thanks in advance.

Rowland Shaw
  • 36,411
  • 12
  • 91
  • 161
  • Why aren't you having the input of the file name within the page? – Rowland Shaw Apr 03 '14 at 10:58
  • Actually this is a phoneGap app and I am firing this videorecorder.xaml page from html page using phoneGap API via javascript. So now I am customizing this videorecorder page to ask name before saving recorded video. –  Apr 03 '14 at 11:01
  • 2
    As you have tried from Coding4fun - have you checked [InputPrompt](https://coding4fun.codeplex.com/wikipage?title=InputPrompt)? – Romasz Apr 03 '14 at 11:05
  • Input prompt is what you want. Toastprompt acts just like the Shell toast. – Clint Rutkas Apr 05 '14 at 05:57

2 Answers2

3

You can use CustomMessageBox from the WP toolbox, like this:

var tb = new TextBox();
var box = new CustomMessageBox()
{
    Caption = "File name",
    Message = "Please enter a file name",
    LeftButtonContent = AppResources.Ok,
    RightButtonContent = AppResources.Cancel,
    Content = tb,
    IsFullScreen = false
};
box.Dismissed += (s, e) =>
{
    if( e.Result == CustomMessageBoxResult.LeftButton )
    {
        var filename = tb.Text;
        // User clicked OK, go ahead and save
    }
};
box.Show();
jlahd
  • 5,877
  • 1
  • 12
  • 19
1

There are a lot of ways to do it but it entirely depends on your choice and need. I would suggest you few ways of doing it and your needs determine the way.

  • Coding4Fun Input Prompt : The basic way to solve your problem. Although you can customize it, it is basic for asking an input like filename and saving it.
  • CustomMessageBox from wptoolbox. Almost similar to coding4fun control
  • usercontrol: This is the one which can be useful when there is huge requirement. Define a textbox with various other UI controls like images, various textblocks etc.
  • Telerik RadInputPromt which gives better UI features but it has to be purchased.

The suggestion I would give is to use coding4fun InputPrompt.

Mani
  • 1,314
  • 13
  • 33