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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:52:56+00:00 2026-05-16T20:52:56+00:00

I have been using WinForms since the first framework introduced and invested a lot

  • 0

I have been using WinForms since the first framework introduced and invested a lot of time and effort in it. Now I am attempting to move to WPF and, honestly, it’s not so easy.

Now I have a task, I need to implement a simple wizard, each page of which has a aligned to center group of controls. The group contains a set of buttons, four button in a row. Width of the group is constant, height is variable — it depends on the number of buttons inside.

alt text

It’s a simple task for WinForms, but I have no idea how to do it using XAML.

I have three questions:

1). Obviously, the buttons inside a group is a WrapPanel which is placed in a Grid’s cell. It’s simple. But how to calculate height of the WrapPanel not using code behind?

2). Which is recommended way to implement wizard? Data template or some kind of Tab Control? I probably will need to have some transition effects when switching pages.

3). Is it acceptable in WPF world to use binding as a way to repositioning controls?

Thank you in advance!

  • 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-16T20:52:56+00:00Added an answer on May 16, 2026 at 8:52 pm

    The WrapPanel will auto-adjust its height based on its contents by default. WPF is a big advancement from WinForms precisely because of the new layout paradigms. No code behind is needed for anything you’ve mentioned.

    As for 2; there are a lot of ways to implement this, depending on how close you adhere to MVVM (if at all); I’d recommend using a styled TabControl at first (you can adjust the style to present visually the steps in the wizard as tabs, without letting the user jump between tabs), as it’s easiest. Also, it’s possible to bind pretty much everything to the TabControl.

    3 is possible, but should be rarely needed. And I mean it.

    Now then; a simple example to show you the power of WPF.
    You can have in your ViewModel (if you’re not familiar with MVVM google it or read any of Josh Smith‘s articles or book or… wow there’s such a wealth of information on it I don’t know which to choose) a collection of objects, let’s say Step classes, which you can bind to the ItemsSource of the TabControl. The TabControl will automatically create a tab for each of your Step.
    Inside your Step class, you can have a collection of items, let’s say… um, Collection<Push> (I’m struggling not to use known classes like Action or Button). If the ItemTemplate of the TabControl contains anything that recognizes that collection, as in a ListBox styled internally to use a WrapPanel for its ItemsContainer, you’re done: the template will show the list of Pushes in a WrapPanel and that’s that.

    Now, I probably shouldn’t write a full tutorial here anyway, but that should get you started. Read up on DataTemplates, ItemsControl etc. (again, I’m having difficulties picking resources… Dr. WPF has awesome articles on both, but they might be a bit advanced) and you should be good to go. Just remember that there’s a good reason why WPF features a lot more fluid layouts than any previous desktop technology, you should become familiar with that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.