예제 #1
0
        protected override void OnInitialized(EventArgs e)
        {
            try
            {
                base.OnInitialized(e);

                Settings.Instance.WndSettings.SetSizeToWindow(this);

                //ウィンドウ位置調整
                var wnds = Application.Current.Windows.OfType <AttendantWindow>().Where(w => w.GetType() == this.GetType()).ToList();
                if (wnds.Count > 1)
                {
                    this.Left = wnds[wnds.Count - 2].Left + 50;
                    this.Top  = wnds[wnds.Count - 2].Top + 25;
                }

                //はみ出ないよう修正
                ViewUtil.AdjustWindowPosition(this);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }