Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8672257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:09:30+00:00 2026-06-12T19:09:30+00:00

I would like to create something like CameraCaptureUI.CaptureFileAsync which will return the result to

  • 0

I would like to create something like CameraCaptureUI.CaptureFileAsync which will return the result to caller (location that user picked through bing maps in my case)
(the same question was asked here but I still need full screen UI or more complete code example)

Assuming the next use case:

  1. CallerPage1 Navigate-> CallerPage2 (through Frame.Navigate(typeof(CallerPage2)) )
  2. CallerPage2 Navigate-> LocationPickingPage (again through Frame.Navigate(typeof(LocationPickingPage )) <- here should be something else but not Frame.Navigate)
  3. User picks a Location and presses done -> location object returned to CallerPage2
    (through Frame.Navigate(typeof(CallerPage2)) )

And now if user presses back on CallerPage2 he/she will be navigated back to LocationPickingPage which is expected in navigation model described above but I wont to navigate him/her to CallerPage1

So this is how CameraCaptureUI.CaptureFileAsync behaves.
Maybe someone can help to look “behind the scenes” of CaptureFileAsync or familiar method and provide some example of how it can be implemented so that location picking can be performed like this:

Location location = await new LocationPickCaptureUI.CaptureLocationAsync();

Any help would be appreciated!

Edit

So, maybe someone can shad some light on how pages can share their data without affecting navigation history. I’m just looking for something like android’s startActivityForResult.

I spend several days on this problem (msdn docs, researching different examples, forums and different sites including this one) and didn’t find any approach so I think it is time to ask own question.

Sharing data between pages in manner I am looking for should be something obvious. Maybe I was looking in a wrong way but the problem is still persist’s.

And please, if someone votes down my question share your mind and your source of knowledge as I still need help on this problem.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:09:32+00:00Added an answer on June 12, 2026 at 7:09 pm

    So, finally I’ve got an appropriate solution and maybe it can be helpful to anybody else.

    The idea is to use Popup object and fit all the screen (however the details seemed like some kind of magic 🙂 )

    One thing: I used UserControl (in Visual Studio right click on project -> Add -> new item.. -> UserControl) template as in this scenario it is easy to manage popups’s content

    Here is the full source for C#:

    CustomCaptureUI.xaml:

    <UserControl
    x:Class="Family.CustomCaptureUI"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Family"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400"
    x:Name="Root">
    
    <Grid>
        <Border BorderBrush="Gray" BorderThickness="1">
            <Grid x:Name="Panel" Background="Gray">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                    <TextBlock Text="New text" Foreground="LightGray" FontSize="18"/>
                    <TextBox x:Name="ToDoText" Width="Auto" BorderBrush="Black" BorderThickness="1" VerticalAlignment="Center"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button x:Name="SubmitButton" Background="Gray" Content="Submit" HorizontalAlignment="Center"/>
                        <Button x:Name="CancelButton" Background="Gray" Content="Cancel" HorizontalAlignment="Center"/>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
    </UserControl>
    

    CustomCaptureUI.xaml.cs:

    public sealed partial class CustomCaptureUI : UserControl
    {
        public enum ResultStatuses
        {
            Canceled,
            Ok,
            None
        }
    
        public CustomCaptureUI()
        {
             _resultStatus = ResultStatuses.None;
            // force content's size to preferable value
            Root.Width = Window.Current.Bounds.Width;
            Root.Height = Window.Current.Bounds.Width * 0.3;
            // Init popup's Content
            _popup.Child = this;
    
            // Init popups's position
            _popup.SetValue(Canvas.LeftProperty, (Window.Current.Bounds.Width - Root.Width) * 0.5);
            _popup.SetValue(Canvas.TopProperty, (Window.Current.Bounds.Height - Root.Height) * 0.5);
        }
    
        public async Task<string> ShowDialog() 
        {
            string result = string.Empty;
            if (_semaphore != null) { DismissAddToDoPopup(); }
    
            // Init a Task for block the ShowDialog-method until user presses Cancel or Submit
            _semaphore = new Task(() => { });
            CancelButton.Click += (sender, e) =>
            {
                _resultStatus = ResultStatuses.Canceled;
                DismissAddToDoPopup();
            };
            SubmitButton.Click += (sender, e) =>
                {
                    result = ToDoText.Text;
                    _resultStatus = ResultStatuses.Ok;
                    DismissAddToDoPopup();
                };
    
            ShowAddToDoPopup();
    
            // actual blocking of ShowDialog
            await _semaphore;
            return result;
        }
    
        public void DismissDialog() 
        {
            _resultStatus = ResultStatuses.Canceled;
            DismissAddToDoPopup();
        }
    
        private void ShowAddToDoPopup()
        {
            ToDoText.Text = string.Empty;
            _popup.IsOpen = true;
        }
    
        private void DismissAddToDoPopup()
        {
            if (_semaphore != null) 
            { 
                // starts the task and allows awaited ShowDialog-method to be released
                // after _semaphore is finishing
                _semaphore.Start();
                _semaphore = null;
            }
            _popup.IsOpen = false;
        }
    
        public ResultStatuses ResultStatus
        {
            get { return _resultStatus; }
        }
    
    
        private Popup _popup = new Popup();
        private Task _semaphore;
        private ResultStatuses _resultStatus;
    
    
    }
    

    And then it can be used like this:

            var dialog = new CustomCaptureUI();
            string result = await dialog.ShowDialog();
            if (dialog.ResultStatus == AddToDoDialog.ResultStatuses.Ok) 
            {
                // Useful stuff
                if (!string.IsNullOrWhiteSpace(result))
                {
                   ...
                }
            }
    

    Hope it can save someone’s time a little

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a class that runs something (a runnable) at regular
I would like create URL rewrite rule that will set default document for my
I would like to create something like this : I have a module that
I'm looking to create something like in this image. Each block would have an
In PHP, to create a new object you would do something like this, $dog
i would like create a array of structure which have a dynamic array :
I would like to create a c++ type that mimic the build-in type exactly.
I would like to create a set of custom controls that are basically image
I would like to know if it is possible to create something like Picture
I would like to create something similar to fb: tag. For example if you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.