public TraderWindow Create(bool showMenu = false)
        {
            var window = new TraderWindow();
            var model  = _objectProvider.Get <TraderWindowModel>();

            if (showMenu)
            {
                model.OnShowMenu();
            }

            window.DataContext = model;

            window.Closing += (sender, e) =>
            {
                if (TabablzControl.GetIsClosingAsPartOfDragOperation(window))
                {
                    return;
                }

                var todispose = ((TraderWindow)sender).DataContext as IDisposable;
                if (todispose != null)
                {
                    todispose.Dispose();
                }
            };

            return(window);
        }
Exemplo n.º 2
0
        public TraderWindow Create(bool showMenu=false)
        {
            var window = new TraderWindow();
            var model = _objectProvider.Get<TraderWindowModel>();
            if (showMenu) model.OnShowMenu();

            window.DataContext = model;

            window.Closing += (sender, e) =>
                              {
                                  if (TabablzControl.GetIsClosingAsPartOfDragOperation(window)) return;

                                  var todispose = ((TraderWindow) sender).DataContext as IDisposable;
                                  if (todispose != null) todispose.Dispose();
                              };

            return window;
        }