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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:37:22+00:00 2026-05-14T02:37:22+00:00

I have a requirement wherein I need to display on a User form, a

  • 0

I have a requirement wherein I need to display on a User form, a Create Button if that user has doesnt have a profile and a Edit Button if he does have a profile. I am using a converter to change the visibility of the button.
Everything works fine initially, but the moment I click on the Create Profile window, and it is the constructor that loads the profile window, after that even if I close that window without doing anything, the Create button turns to edit. My guess is that, it is because the constructor would have create the profile object and so even though the object is empty it shows me edit button instead of create. Is there any other way I could display button visibility??

  • 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-14T02:37:23+00:00Added an answer on May 14, 2026 at 2:37 am

    Do you really need to alter the button’s visibility? This is not generally a great user-experience practice as it can confuse people about what they need to do next.

    To simply disable the button, you could add logic to the local:LaunchEditor command’s CanExecute method. There’s also a CanExecuteChanged event which allows the UI to dynamically respond to changes in the command’s accessibility. This may be the easiest thing to do.

    If you really need to hide the button, then you can probably create a style with a trigger based on the button’s IsEnabled property which will make the button’s visibility Hidden when IsEnabled==false. You should, however, still use the command to control the accessibility of the button.

    In your case, you would write two methods: CanCreateProfile and CanEditProfile, and include these in your command binding (either in XAML or in the codebehind):

    private void CanCreateProfile(object sender, CanExecuteRoutedEventArgs e)
    {
        e.CanExecute = userProfile == null;
    }
    
    private void CanEditProfile(object sender, CanExecuteRoutedEventArgs e)
    {
        e.CanExecute = userProfiel != null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement in JasperReports wherein I need to display the field based
I have a requirement wherein I need to display a list of employees and
I am new to extension development, I have a requirement wherein I need to
We have a requirement, wherein the administrative user needs to proxy in as a
I have a requirement, wherein i need to show a wait message while an
I have a requirement where in need to display the Pdf / Word doc(any
I have requirement to write help(for example show description of what some button does)
I have a requirement wherein I need to launch an application (assumed to be
I have requirement, wherein I have to calculate totals for cash and credit cards
I have requirement like, suppose I have a 'property' table which has 'ListingKey' field

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.