wpf mdi setting default startup location center screen

Feb 11, 2011 at 3:13 AM
Edited Feb 11, 2011 at 3:14 AM

I was trying to setting up the pre-maked wpf window to dock inside mdi

but the default value from window seem no longer taking affect

may i know how could i re-fix this ?

Thx in advance

while now i'm using mobile to post question but i will post the code used to call up window to http://1myb.com soon @.@

Feb 11, 2011 at 11:36 AM

Currently, there's only two properties:
1) Point Position -- position of top left corner of window.
2) WindowState WindowState -- normal, maximized or minimized.

Don't know anything about built-in window docking. Can you provide sample code?

Feb 11, 2011 at 5:09 PM
Edited Feb 12, 2011 at 1:40 AM

No problem =D

Here is the code ofbutton

 

	private void Member_Approval_Click(object sender, RoutedEventArgs e){
             
            MemberApproval mbapr=new MemberApproval();
            Container.Children.Add(new MdiChild()
            {
                Title = mbapr.Title,
                Content = mbapr.Content as UIElement,
                Width = mbapr.Width,
                Height = mbapr.Height            
            });

         }
while

                        <MenuItem Header="Member Approval System" Click="Member_Approval_Click" IsEnabled="False" Name="miMemberApproval" />
this line used to make up a link
inside the window i want to make it center i choose option from drop down as window center

i think this maybe another two problem i can't solve =>
while i make the window maximize, and change the theme to generic
trying to changing window by clicking the || button at right top
sudden not responding
=>
while i open more than one window and every window is dock with using the code put inside MDI and one line of calling reference through child MDI
also bring me situation of not responding

may i know probably what caused this problem ?

Thx for reply =D
Feb 14, 2011 at 7:40 AM

no solution beside make it position number to center ??

Feb 17, 2011 at 1:25 PM

1) Hmm... do you need WindowStartupLocation property for MdiChild?
That's easy, CenterParent case would be smth like this:

double x = Container.ActualWidth / 2 - ActualWidth / 2;
if (x < 0) x = 0;
// same for y
Position = new Point(x, y);

2) Themes can't be changed in maximized mode. It's limitation in ver. 1.1. Low-priority issue.

3)

spencerlim wrote:
one line of calling reference through child MDI

Can't get it. Can you explain?

Feb 17, 2011 at 2:10 PM
stbear wrote:

1) Hmm... do you need WindowStartupLocation property for MdiChild?
That's easy, CenterParent case would be smth like this:

double x = Container.ActualWidth / 2 - ActualWidth / 2;
if (x < 0) x = 0;
// same for y
Position = new Point(x, y);

2) Themes can't be changed in maximized mode. It's limitation in ver. 1.1. Low-priority issue.

3)

spencerlim wrote:
one line of calling reference through child MDI

Can't get it. Can you explain?

Thx, that is =D

Never mind, forget about 3. ^^