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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:55:55+00:00 2026-05-20T11:55:55+00:00

As a new comer to WPF, I would like to clarify my approach to

  • 0

As a new comer to WPF, I would like to clarify my approach to build a UI in WPF. I am using WPF with MVVM. My approach is to use a main window which contains user controls which can run several levels deep in the UI tree. For example, I have an editor in a window. Many items can be edited in the editor and the UI for each items are different, but the editor always shows an OK and Cancel button. So the main editor window with OK and Cancel can be shared between several editors. I am designing the app in such a way that the editor user control will just bind the view model for the item which is edited. So when designing the UI for editing individual items OK or Cancel Button is not pulled in, but simply put the item into the main editor which will provide the buttons. I am pretty sure I can handle the commands correctly with WPF command infrastructure.

If I can make it clear with some xaml here it is.Please dont mind the control placement itself, I mean to explain the basic idea of sharing the Common UI across many items.

<UserControl Name="EditorMainWindow"> 
 <Grid>
   <StackPanel>
        <ItemsControl ItemsSource="{Binding ItemToBeEdited}">                
        </ItemsControl>  
       <Button Content="OK" Width="120" Command="{Binding SomethingforOK}" />
       <Button Content="Cancel" Width="120" Command="{Binding SomethingforCancel}"/>         
    </StackPanel>               
 </Grid>
</UserControl>     

The way I am doing it, the user interface tree can go several levels deep. I will be tremendously benefitted, because if the client ask to change the UI in one particular place, I need not got and change it in many places(provided it is shared).

As I am new to WPF I would like to know if there is any catch in this approach. Could you please tell me if this makes sense or not?

  • 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-20T11:55:56+00:00Added an answer on May 20, 2026 at 11:55 am

    You can save yourself a lot of time. Catel already provides such a window:

    DataWindow

    It is fully ready for MVVM (Catel is also an MVVM framework) which supports dynamic nested user controls. The nice thing is that it also supports error handling out of the box, so as soon as an error occurs in the window template, the user will see the error in the InfoBarMessageControl.

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

Sidebar

Related Questions

Every time a new feature like WPF comes along, it's added to the .Net
I am binding a combobox in the WPF using MVVM pattern. I am able
I am new to WPF environment and I am experiencing some problems like if
I am developing an application in WPF using the MVVM pattern. If I have
I would like to build a mobile app, brewed from nothing more but html/css
I've done several WPF application(not using MVVM) in the past and I had always
I'm a new comer to the kinect environment, and i was trying to modify
i am using web service asmx, whenever a new request comes, all objects will
I have downloaded several new plugins which come with a help file. None of
The aim I would like to set such size for the DataGrid (standard, from

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.