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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:04:07+00:00 2026-06-07T06:04:07+00:00

Sorry for the title, I just don’t know how to explain it in one

  • 0

Sorry for the title, I just don’t know how to explain it in one sentence.

So here is my goal: I need to have a boolean in my ViewModel define the visibility for a control (border).

I know I can achieve this with a BooleanToVisibilityConverter, but there is a little more to it. I want a button on my UI to be shown if the control is not visible. Once that button is pushed, then I want the boolean in my ViewModel to be TRUE and then I want the control to be visible and the button that was just pushed to be collapsed. Once that control is visible, I would like a button within that recently visible control to make the control collapsed and then make the original button visible.

Basically, there are two buttons: 1 to make visible (then collapse itself) and the other is to collapse its container and then make the first button visible.

I am trying to do all this with MVVM so if I can avoid code behind in my View that would be ideal!

  • 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-07T06:04:10+00:00Added an answer on June 7, 2026 at 6:04 am

    Since you’re using ICommands on your viewmodel, this should work…Assume your commands are “ShowBorderCommand” and “HideBorderCommand” and the property on your viewmodel is “ShowBorder”

    <ConverterNamespace:BooleanToVisibilityConverter x:Key="BoolToVis"/>
    <ConverterNamespace:ReverseBooleanToVisibilityConverter x:Key="BoolToCollapse"/>
    
    <Border Visibility="{Binding ShowBorder, Converter={StaticResource BoolToVis}}">
        <Button Command="{Binding HideBorderCommand}"/>
    </Border>
    
    <Button Command="{Binding ShowBorderCommand}" Visbility="{Binding ShowBorder, Converter={StaticResource BoolToCollapse}}"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for the messy title, I just don't know how to describe the problem
Using MS Access. I'm sorry that the title is vague--i just don't exactly know
Sorry, I don't really know how to title this question. Here's my code in
Sorry for the title but I don't know other way of asking. EDITED FOR
Sorry about the weird question title, but I don't really know what to call
Sorry for long title, I don't know even the way on how to express
Sorry for unclear title, but I don't know how to state it properly (feel
Sorry for the dramatic sounding title, just wanted to know if there is a
I'm sorry about the title I'm just not sure how to describe this one.
Sorry about the vague question title, but I have these typedefs here: typedef std::list<AnimationKeyframe>

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.