Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            var model = new Models.MainWindowModel();
            var vm    = new ViewModels.MainWindowViewModel(this, model);

            DataContext = vm;
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            var windowService = new MainWindowService(this)
            {
                ConsoleTextBox = ConsoleTextBox
            };
            var mainWindowModel = new Models.MainWindowModel();
            var vm = new ViewModels.MainWindowViewModel(windowService, mainWindowModel, this);

            DataContext = vm;
            model       = mainWindowModel;

            Loaded += (sender, args) => { vm.Loaded.Execute(null); };
        }
Exemplo n.º 3
0
        private void initPages()
        {
            _page = new Models.MainWindowModel();
            IEnumerable<Type> types =  ((FrameWork.Intelligence.CoreIntelligence)BaseIntelligence)
                .PluginIntelligence
                .LoadedPluginTypes
                .Where(w => w.IsSubclassOf(typeof(FrameWork.Plugins.PagePlugins.BasePagePlugin)));

            _page.Pages = new AsyncObservableCollection<FrameWork.Plugins.PagePlugins.BasePagePlugin>();

            foreach (Type type in types)
            {
                FrameWork.Plugins.PagePlugins.BasePagePlugin pagePlugin = (FrameWork.Plugins.PagePlugins.BasePagePlugin)BaseIntelligence.CoreIntelligence.PluginIntelligence.TryCreatingInstance(type);
                if (pagePlugin.IsWelcomeScreen == !BaseIntelligence.CoreIntelligence.UserIntelligence.LoggedIn)
                {
                    pagePlugin.Load();
                    _page.Pages = _page.Pages.Union(new List<FrameWork.Plugins.PagePlugins.BasePagePlugin>() { pagePlugin });
                }
            }
            _page.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_page_PropertyChanged);
            NotifyPropertyChanged("Page");
            NotifyPropertyChanged("HeadingList");
        }