Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 C# Windows VB.NET
Hi,
I want to develop to a wpf windows application in C#.net.
I have a main window . in that i have a tabcontrol and i dynamically adding tab item like this
private void MnuDepartment_Click(object sender, RoutedEventArgs e)
        {
 
            DepartmentMaster objDepartmentMaster = new DepartmentMaster();
            ClosableTabItem tabitem = new ClosableTabItem();
 
            tabitem.Header = objDepartmentMaster.Title;
            object childContent = objDepartmentMaster.Content;
            objDepartmentMaster.Content = null;
            tabitem.Content = childContent as UIElement;
            if (tabChild.Items.Count > 0)
            {
                foreach (TabItem tab in tabChild.Items)
                {
                    if (tab.Header.ToString().ToUpper() == tabitem.Header.ToString().ToUpper())
                    {
                        tab.Focus();
                        return;
                    }
                }
            }
            tabChild.Items.Add(tabitem);
            tabChild.SelectedItem = tabitem;
 
        }
 
I have some button in main screen for save ,delete
 
how can i call child window save function on save button click in parent window.
 
Ultimately i wanted to develop like mdi application in wpf.
 
suggest any other better way to achieve mdi in wpf.
Posted 19-Nov-12 18:44pm
Comments
Sergey Alexandrovich Kryukov at 20-Nov-12 0:02am
   
First of all, don't call it MDI -- this is a bad word. What you do is not bad.
Also, there is no effective child-parent relationships between windows. Don't call those "child windows", they are FrameworkElements (for example, Panels), but not windows...
 
The problem itself seems artificial to me. You can expose any members of child elements. I cannot understand how it can make a difficulty. What did you try?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 305
1 OriginalGriff 295
2 Sergey Alexandrovich Kryukov 207
3 Peter Leow 175
4 Afzaal Ahmad Zeeshan 154
0 OriginalGriff 7,460
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100