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 8767547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:50:36+00:00 2026-06-13T16:50:36+00:00

In my WPF application a document has two properties , report name and file

  • 0

In my WPF application a document has two properties , report name and file name. In the UI the user fills in the report name and the file name is automatically populated with report name as default.
In the dialog that creates new documents i have

<TextBox x:Name="tbReportName" Grid.Row="0" Grid.Column="1" Style="{StaticResource DialogInputStyle}"
         Text="{Binding UpdateSourceTrigger=PropertyChanged, Path=ReportName,
                ValidatesOnDataErrors=true, NotifyOnValidationError=true}" />

and

 <TextBox  Grid.Row="5" Grid.Column="1" Text="{Binding Text,ElementName=tbReportName,UpdateSourceTrigger=PropertyChanged,Mode=OneWay,Converter={StaticResource safefilenamConverter}}"  Style="{StaticResource DialogInputStyle}" >

The report name is bound to a property in the viewmodel and i need to do the same with file name

The user can choose to use the default file name or change it in the textbox. I need to bind the value of the file name textbox to a property in my viewmodel but the binding is already used to get the value from the report name textbox.

Not sure what to use if i want to stay MVVM

Multibinging, triggers…. any ideas?

  • 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-13T16:50:38+00:00Added an answer on June 13, 2026 at 4:50 pm

    Does it have to be in XAML? You could just set the FileName property if it’s blank when you set ReportName:

    private string _reportName;
    public string ReportName
    {
        get { return _reportName; }
        set
        {
            _reportName = value;
            if(string.IsNullOrEmpty(FileName))
            {
                FileName = _reportName;
            }
            OnPropertyChanged("ReportName");
        }
    }
    
    private string _fileName;
    public string FileName
    {
        get { return _fileName; }
        set
        {
            _fileName = value;
            OnPropertyChanged("FileName");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a WPF application that uses one document at a time. Is there
I have wpf application and it needs report printing. for example daily, monthly sales.
I've been working on a WPF application for a while, and the time has
I like DocumentViewer for display of an XPS document in a WPF application. But
For a WPF UI application, a CHM Help file needs to be created. How
I'm building a WPF application in which I need to display document previews such
I have a WPF application where I use a document viewer. I also start
I have WPF application in which user enters some text in rich text box(rtb),
It is a WPF application. I am trying to load a xml file like
Basically I have embedded a xps file in a WPF application containing a XPSDocument

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.