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

  • SEARCH
  • Home
  • 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 4027100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:03:17+00:00 2026-05-20T11:03:17+00:00

I need to update textblock inside childWindow based on file name that is being

  • 0

I need to update textblock inside childWindow based on file name that is being selected with OpenDialog Window. Since I am not running OpenDialog from childWindow I have trouble passing that value to the texblock inside ChildWindow. I am wondering if someone can help. As a result of th issue I have, I am wondering if it is possible to have OpenDialog inside ChildWindow? Thank you for any ideas!

ChildWindow xaml:

<sdk:ChildWindow 
x:Class="AddPackages_ChildWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"   
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
AutomationProperties.AutomationId="AddPackages_ChildWindow">

<Grid x:Name="AddPackages_ChildWindow_LayoutRoot" AutomationProperties.AutomationId="AddPackages_ChildWindow_LayoutRoot" Style="{StaticResource AVV_GridStyle}">
    <TextBlock x:Name="txtUpdate_Package" AutomationProperties.AutomationId="txtUpdate_Package" Text="FileName" />  </Grid>

Below is the code to open DialogBox and passing selected file name:

private void Package_Click(object sender, System.Windows.RoutedEventArgs e)
    {
        AddPackage_ChildWindow ap = new AddPackage_ChildWindow();
        ap.Show();

        OpenFileDialog openFileDialog1 = new OpenFileDialog();
        openFileDialog1.Filter = "App-V Packages (*.sprj)|*.sprj|App-V Packages (*.sprj)|*.sprj";
        openFileDialog1.FilterIndex = 1;

        openFileDialog1.Multiselect = true;

        bool? userClickedOK = openFileDialog1.ShowDialog();

        if (userClickedOK == true)
        {
            //passing the file name string
            txtUpdate_Package.Text = openFileDialog1.File.Name;
            System.IO.Stream fileStream = openFileDialog1.File.OpenRead();

            using (System.IO.StreamReader reader = new System.IO.StreamReader(fileStream))
            {
                // Read the first line from the file and write it the textbox.
                // txtUpdate_Package.Text = reader.ReadLine();
            }
            fileStream.Close();
        }
    }
  • 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-05-20T11:03:17+00:00Added an answer on May 20, 2026 at 11:03 am

    You could expose a SetText method on your ChildWindow class like so:

    public void SetText(string text) {
        this.txtUpdate_Package.Text = text;
    }
    

    Then you’d call it like so from your Package_Click method:

    ap.SetText(reader.ReadLine());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a textblock inside a list view that I need to hide or
I need to update a field (which is currently empty) based on a match
I need to update two tables inside a single transaction. The individual queries look
I need to update table and set table . related_id (column that binds the
I need to update a combobox with a new value so it changes the
I need to update a record in a database with the following fields [ID]
I need to update a group of cells by inserting the same two characters
I need to update the comments field in a table for a large list
I need to update an existing SharePoint content type by adding a new field
I need to update the primary key for a record but it's also the

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.