Example #1
0
        public void DockLast()
        {
            var window = DialogExtensions.GetAll <PlotWindow>().LastOrDefault();

            if (window != null)
            {
                Dock(window.DataContext);
            }
        }
Example #2
0
        PlotViewModel ConvertToViewModel(Object obj)
        {
            if (obj is PlotValue)
            {
                return(_contexts.FirstOrDefault(m => Object.ReferenceEquals(m.Plot, obj)) ??
                       DialogExtensions.GetAll <PlotWindow>().
                       Select(m => m.DataContext as PlotViewModel).
                       Where(m => m != null).
                       FirstOrDefault(m => Object.ReferenceEquals(m.Plot, obj)));
            }

            return(obj as PlotViewModel);
        }
Example #3
0
        public void Dock(Object obj)
        {
            var context = ConvertToViewModel(obj);

            if (context != null)
            {
                App.Current.Dispatcher.Invoke(() =>
                {
                    DialogExtensions.GetAll <PlotWindow>().Where(m => Object.ReferenceEquals(m.DataContext, context)).ForEach(window =>
                    {
                        Display(context);
                        window.Close();
                    });
                });
            }
        }