Example #1
0
        private bool __OpenChildWindow(ChildWindow Window, ChildWindowViewModelBase ViewModel)
        {
            var Temp = ChildWindows.FirstOrDefault(c => c.Identifier == Window.Identifier);

            if (Temp != null)
            {
                Temp.Focus();
                return(false);
            }

            Window.DataContext = ViewModel;
            m_ChildViewModels.Add(ViewModel);
            ChildWindows.Add(Window);

            Window.Closed += (sender, e) =>
            {
                ChildWindows.Remove(Window);
                m_ChildViewModels.Remove(ViewModel);
            };

            ViewModel.OpenWindow += (sender, e) =>
            {
                __OpenChildWindow(e.Window, e.ViewModel);
            };

            ViewModel.StatusBarTextChanged += (sender, text) => StatusBarText = text;

            return(true);
        }
Example #2
0
 protected void OnOpenWindow(ChildWindowViewModelBase ViewModel, ChildWindow Window)
 {
     if (OpenWindow != null)
     {
         OpenWindow(this, new OpenWindowEventArgs(ViewModel, Window));
     }
 }
Example #3
0
 public OpenWindowEventArgs(ChildWindowViewModelBase ViewModel, ChildWindow Window)
 {
     this.ViewModel = ViewModel;
     this.Window    = Window;
 }