public BasePage() : base()
    {
        InitializeComponent();
        ViewModel = Lib.IoC.Get <MainPageViewModel>();
        var manipulator = new DictionaryResourceManipulator(this.Contents.Resources);

        _appsViewSource = manipulator.Get <CollectionViewSource>("FilteredApps");
        this.Loaded    += OnLoaded;
    }
示例#2
0
        public ApplicationSummaryPage()
        {
            InitializeComponent();
            ViewModel = IoC.Get <ApplicationSummaryViewModel>();

            _manipulator            = new DictionaryResourceManipulator(this.Contents.Resources);
            _modsViewSource         = _manipulator.Get <CollectionViewSource>("FilteredMods");
            _modsViewSource.Filter += ModsViewSourceOnFilter;
            AnimateOutFinished     += Dispose;
        }
示例#3
0
    /// <inheritdoc />
    public LoadModSelectDialog(LoadModSelectDialogViewModel viewModel)
    {
        InitializeComponent();
        ViewModel = viewModel;

        // Setup filters
        var manipulator = new DictionaryResourceManipulator(this.Contents.Resources);

        _modsViewSource         = manipulator.Get <CollectionViewSource>("FilteredMods");
        _modsViewSource.Filter += ModsViewSourceOnFilter;
    }
    public AppSummaryPage(ApplicationViewModel appViewModel)
    {
        InitializeComponent();
        ViewModel = new ConfigureModsViewModel(appViewModel, Lib.IoC.Get <ModUserConfigService>());

        ControllerSupport.SubscribeCustomInputs(OnProcessCustomInputs);
        _manipulator            = new DictionaryResourceManipulator(this.Contents.Resources);
        _modsViewSource         = _manipulator.Get <CollectionViewSource>("FilteredMods");
        _modsViewSource.Filter += ModsViewSourceOnFilter;
        SwappedOut             += Dispose;
    }
        public SetDependenciesDialog(ModConfigService modConfigService, PathTuple <ModConfig> config)
        {
            InitializeComponent();
            ViewModel = new SetDependenciesDialogViewmodel(modConfigService, config);

            var manipulator = new DictionaryResourceManipulator(this.Contents.Resources);

            _dependenciesViewSource         = manipulator.Get <CollectionViewSource>("SortedDependencies");
            _dependenciesViewSource.Filter += DependenciesViewSourceOnFilter;

            this.Closed += OnClosed;
        }
        public LoadModSelectDialog(ApplicationViewModel applicationViewModel, ReloadedAppViewModel reloadedAppViewModel)
        {
            InitializeComponent();
            ApplicationViewModel = applicationViewModel;
            ReloadedAppViewModel = reloadedAppViewModel;

            // Setup filters
            var manipulator = new DictionaryResourceManipulator(this.Contents.Resources);

            _modsViewSource         = manipulator.Get <CollectionViewSource>("FilteredMods");
            _modsViewSource.Filter += ModsViewSourceOnFilter;
        }
示例#7
0
        public CreateModViewModel(ModConfigService modConfigService, DictionaryResourceManipulator manipulator)
        {
            /* Build Dependencies */
            var mods = modConfigService.Mods; // In case collection changes during window open.

            foreach (var mod in mods)
            {
                Dependencies.Add(new BooleanGenericTuple <IModConfig>(false, mod.Config));
            }

            _dependenciesViewSource         = manipulator.Get <CollectionViewSource>("SortedDependencies");
            _dependenciesViewSource.Filter += DependenciesViewSourceOnFilter;
        }
示例#8
0
        public ManageModsPage() : base()
        {
            InitializeComponent();
            ViewModel                       = IoC.Get <ManageModsViewModel>();
            this.DataContext                = ViewModel;
            this.AnimateOutStarted         += SaveCurrentMod;
            IoC.Get <MainWindow>().Closing += OnMainWindowClosing;

            // Setup filters
            var manipulator = new DictionaryResourceManipulator(this.Contents.Resources);

            _modsViewSource         = manipulator.Get <CollectionViewSource>("SortedMods");
            _appsViewSource         = manipulator.Get <CollectionViewSource>("SortedApps");
            _modsViewSource.Filter += ModsViewSourceOnFilter;
            _appsViewSource.Filter += AppsViewSourceOnFilter;
        }
示例#9
0
    public ManageModsPage() : base()
    {
        SwappedOut += Dispose;
        InitializeComponent();
        ViewModel            = Lib.IoC.GetConstant <ManageModsViewModel>();
        this.DataContext     = ViewModel;
        _mainWindow          = Lib.IoC.GetConstant <MainWindow>();
        _mainWindow.Closing += OnMainWindowClosing;

        // Setup filters
        var manipulator = new DictionaryResourceManipulator(this.Contents.Resources);

        _modsViewSource         = manipulator.Get <CollectionViewSource>("SortedMods");
        _appsViewSource         = manipulator.Get <CollectionViewSource>("SortedApps");
        _modsViewSource.Filter += ModsViewSourceOnFilter;
        _appsViewSource.Filter += AppsViewSourceOnFilter;
    }
示例#10
0
        /* Note: All sizes are in points, not pixels. */

        public WindowViewModel(Window window) : base(window)
        {
            // Load window style.
            Resources = new DictionaryResourceManipulator(Application.Current.Resources);
            _window   = window;

            // Notify drop shadow/border on change of state
            // or window dock position.
            TargetWindow.StateChanged += (sender, args) => GlowStateChanged();
            WindowDockChanged         += position => DockPosition = position;

            // Enable/Disable Glow based off of XAML preferences once
            // the window fully loads.
            TargetWindow.Loaded += (sender, args) =>
            {
                EnableGlow = EnableGlow;
            };

            // Set initial minimum window sizes if not defined.
            if (Math.Abs(TargetWindow.MinHeight) < 0.1F)
            {
                TargetWindow.MinHeight = Resources.Get <double>(XAML_DefaultMinHeight);
            }

            if (Math.Abs(TargetWindow.MinWidth) < 0.1F)
            {
                TargetWindow.MinWidth = Resources.Get <double>(XAML_DefaultMinWidth);
            }

            // Set default glow colour.
            GlowColor = GlowColorDefault;

            // Handle window state changes.
            TargetWindow.Deactivated += (sender, args) =>
            {
                if (!IgnoreInactiveState)
                {
                    this._lastState = this.WindowState;

                    // Ignore if special state and flag set.
                    if (IgnoreInactiveStateWhenSpecialState && WindowState != State.Normal)
                    {
                        return;
                    }

                    this.WindowState = State.Inactive;
                }
            };

            TargetWindow.Activated += (sender, args) =>
            {
                if (this._lastState == State.Inactive)
                {
                    this.WindowState = State.Normal;
                }
                else
                {
                    this.WindowState = this._lastState;
                }
            };

            // Fun
            if (Resources.Get <bool>(XAML_EnableGlowHueCycle))
            {
                EnableHueCycleDropShadow(
                    Resources.Get <Color>(XAML_GlowHueCycleColor),
                    Resources.Get <int>(XAML_GlowHueCycleFramesPerSecond),
                    Resources.Get <int>(XAML_GlowHueCycleLoopDuration));
            }

            window.Closing += WindowOnClosing;
        }
        public SetDependenciesDialogViewmodel(ManageModsViewModel manageModsViewModel, DictionaryResourceManipulator manipulator)
        {
            ManageModsViewModel = manageModsViewModel;
            CurrentMod          = ManageModsViewModel.SelectedModTuple;

            _dependenciesViewSource         = manipulator.Get <CollectionViewSource>("SortedDependencies");
            _dependenciesViewSource.Filter += DependenciesViewSourceOnFilter;
            PopulateDependencies();
        }