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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:59:47+00:00 2026-05-11T04:59:47+00:00

I have quite a basic WPF form with a DockPanel, there’s a Menu bar,

  • 0

I have quite a basic WPF form with a DockPanel, there’s a Menu bar, a Status bar, and a UserControl. Like so:

<DockPanel>   <Menu DockPanel.Dock='Top'>     ...   </Menu>   <StatusBar DockPanel.Dock='Bottom'>     ...   </StatusBar>   <UserControls:MyUserControl /> <DockPanel> 

My problem is: Based on an event, I want to transition the UserControl to a second user control.

There’s no problem with them both being defined in the XAML (as I know what the other control will be), but I just can’t work out the type of container I need for this that will allow me to use an animation (ideally something like one disappearing to the left and the other appearing from the right). The UserControls should grow automatically to use up all the available space.

Any ideas?

Edit: Here’s what I’m trying to do in a general sense. Maybe someone can suggest a better way.

I have a ListView/GridView that has a list of clients. When the user double clicks on a client I want to replace the list of clients with a UserControl that displays details on that client (and further allows them to interact).

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T04:59:47+00:00Added an answer on May 11, 2026 at 4:59 am

    Found out a way of doing it. I put a grid where the UserControl was before and then put both UserControls inside that. Set one to visible and one to collapsed. Then on the event fire I can play my animation which (among other things) swaps the visibility.

    So in my window I have

    <Grid>     <UserControls:Control1 x:Name='Control1' />     <UserControls:Control2 x:Name='Control2' /> </Grid> 

    Then in the window resources this

    <Storyboard x:Key='ShowControl2'>     <ObjectAnimationUsingKeyFrames BeginTime='00:00:00' Storyboard.TargetName='Control1' Storyboard.TargetProperty='(UIElement.Visibility)'>         <DiscreteObjectKeyFrame KeyTime='00:00:00.2000000' Value='{x:Static Visibility.Collapsed}'/>     </ObjectAnimationUsingKeyFrames>     <ObjectAnimationUsingKeyFrames BeginTime='00:00:00' Storyboard.TargetName='Control2' Storyboard.TargetProperty='(UIElement.Visibility)'>         <DiscreteObjectKeyFrame KeyTime='00:00:00' Value='{x:Static Visibility.Visible}'/>     </ObjectAnimationUsingKeyFrames>     <DoubleAnimationUsingKeyFrames BeginTime='00:00:00' Storyboard.TargetName='Control1' Storyboard.TargetProperty='(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)'>         <SplineDoubleKeyFrame KeyTime='00:00:00.2000000' Value='0'/>     </DoubleAnimationUsingKeyFrames>     <DoubleAnimationUsingKeyFrames BeginTime='00:00:00' Storyboard.TargetName='Control2' Storyboard.TargetProperty='(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)'>         <SplineDoubleKeyFrame KeyTime='00:00:00' Value='0'/>         <SplineDoubleKeyFrame KeyTime='00:00:00.2000000' Value='1'/>     </DoubleAnimationUsingKeyFrames> </Storyboard> 

    Then in the code when I want to hide control 1 and show control 2, I have this:

    Storyboard showControl2Animation = (Storyboard)FindResource('ShowControl2'); showControl2Animation .Begin(); control2.Focus(); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem is quite basic. I have a JTable showing cached data from a
I have quite a few RewriteRules in my .htaccess that looks like this RewriteRule
I have a quite old templating system written on top of ERB. It relies
I have been programming with .NET 2.0 version for quite sometime and would like
I have quite a large list of words in a txt file and I'm
I have quite a few cells that link to other worksheets/books, etc with standard
I have quite a lot of PHP view files, which I used to include
As the title suggests, I'm using Google App Engine and Django. I have quite
I have (after quite a bit of work) a web test that will upload
I have a quite big XML output from an application. I need to process

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.