public void InitializeCommandsTest() { var database = new GameDatabase(); var controllers = new GameControllerFactory(); var model = new DesktopAppViewModel( database, null, null, null, new PlayniteSettings(), new DesktopGamesEditor( new GameDatabase(), controllers, new PlayniteSettings(), null, null, null), null, new ExtensionFactory(database, controllers), null); var props = typeof(DesktopAppViewModel).GetProperties(); foreach (var prop in props) { if (prop.Name.EndsWith("Command")) { var cmd = prop.GetValue(model, null); if (cmd == null) { Assert.Fail($"{prop.Name} is not defined."); } } } }
public MainMenu(DesktopAppViewModel model) { if (model != null) { mainModel = model; InitializeItems(); } }
public SoftwareToolSidebarItem(AppSoftware app, DesktopAppViewModel model) { this.app = app; this.model = model; Type = SiderbarItemType.Button; Icon = app.Icon; Title = app.Name; Activated = () => model.StartSoftwareToolCommand.Execute(app); }
public GameGroupMenu(PlayniteSettings settings, DesktopAppViewModel mainModel) { this.settings = settings; this.mainModel = mainModel; CollapseCommand = new RelayCommand <object>((a) => Collapse()); CollapseAllCommand = new RelayCommand <object>((a) => CollapseAll()); ExpandCommand = new RelayCommand <object>((a) => Expand()); ExpandAllCommand = new RelayCommand <object>((a) => ExpandAll()); Opened += GameGroupMenu_Opened; }
public ExplorerPanel(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = new DesignMainViewModel(); } else if (mainModel != null) { this.mainModel = mainModel; } }
public GameListItem(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = new DesignMainViewModel(); } else if (mainModel != null) { this.mainModel = mainModel; } }
public FilterPanel(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = DesignMainViewModel.DesignIntance; } else if (mainModel != null) { this.mainModel = mainModel; } }
public MainMenu(DesktopAppViewModel model) { if (DesignerProperties.GetIsInDesignMode(this)) { mainModel = DesignMainViewModel.DesignIntance; } else if (model != null) { mainModel = model; InitializeItems(); } }
public LibraryListView(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = DesignMainViewModel.DesignIntance; } else if (mainModel != null) { this.mainModel = mainModel; } this.mainModel.AppSettings.ViewSettings.PropertyChanged += ViewSettings_PropertyChanged; }
public Library(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = new DesignMainViewModel(); } else if (mainModel != null) { this.mainModel = mainModel; } mainModel.AppSettings.PropertyChanged += AppSettings_PropertyChanged; }
public Sidebar(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = DesignMainViewModel.DesignIntance; } else if (mainModel != null) { this.mainModel = mainModel; } DataContext = this.mainModel; }
public MainWindow(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = new DesignMainViewModel(); } else if (mainModel != null) { this.mainModel = mainModel; } DataContext = this.mainModel; }
public GameMenu(DesktopAppViewModel model) { if (model == null) { return; } this.model = model; resources = new ResourceProvider(); Opened += GameMenu_Opened; Closed += GameMenu_Closed; DataContextChanged += GameMenu_DataContextChanged; }
public GameMenu(DesktopAppViewModel model) { if (model == null) { return; } context = SynchronizationContext.Current; this.model = model; resources = new ResourceProvider(); Opened += GameMenu_Opened; DataContextChanged += GameMenu_DataContextChanged; InitializeItems(); }
public TopPanel(DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = DesignMainViewModel.DesignIntance; } else if (mainModel != null) { this.mainModel = mainModel; } Loaded += TopPanel_Loaded; Unloaded += TopPanel_Unloaded; }
public BaseGamesView(ViewType viewType, DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = new DesignMainViewModel(); } else if (mainModel != null) { this.mainModel = mainModel; } this.viewType = viewType; mainModel.AppSettings.ViewSettings.PropertyChanged += ViewSettings_PropertyChanged; }
public FilterPresetsMenu(DesktopAppViewModel model) { if (DesignerProperties.GetIsInDesignMode(this)) { mainModel = DesignMainViewModel.DesignIntance; } else if (model != null) { mainModel = model; Opened += FilterPresetsMenu_Opened; } Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom; StaysOpen = false; }
public BaseGamesView(ViewType viewType, DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = DesignMainViewModel.DesignIntance; } else if (mainModel != null) { this.mainModel = mainModel; } this.viewType = viewType; Loaded += BaseGamesView_Loaded; Unloaded += BaseGamesView_Unloaded; }
public GameOverview(ViewType viewType, DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = DesignMainViewModel.DesignIntance; DataContext = this.mainModel.SelectedGameDetails; } else if (mainModel != null) { this.mainModel = mainModel; } this.viewType = viewType; this.mainModel.AppSettings.PropertyChanged += AppSettings_PropertyChanged; this.mainModel.AppSettings.ViewSettings.PropertyChanged += ViewSettings_PropertyChanged; }
public MainSidebarViewItem(Control view, DesktopAppViewModel model, ApplicationView appView) { this.view = view; this.AppView = appView; this.model = model; Type = SiderbarItemType.View; Opened = () => { if (AppView == ApplicationView.Statistics) { model.LibraryStats.Calculate(); } return(view); }; }
public GameOverview(ViewType viewType, DesktopAppViewModel mainModel) { if (DesignerProperties.GetIsInDesignMode(this)) { this.mainModel = DesignMainViewModel.DesignIntance; DataContext = this.mainModel.SelectedGameDetails; } else if (mainModel != null) { this.mainModel = mainModel; } this.viewType = viewType; Loaded += GameOverview_Loaded; Unloaded += GameOverview_Unloaded; }
public LibraryGridView(DesktopAppViewModel mainModel) : base(ViewType.Grid, mainModel) { Loaded += LibraryGridView_Loaded; Unloaded += LibraryGridView_Unloaded; }
public TrayContextMenu(DesktopAppViewModel model) { mainModel = model; mainModel.GamesEditor.PropertyChanged += GamesEditor_PropertyChanged; InitializeItems(); }
public LibraryDetailsView(DesktopAppViewModel mainModel) : base(ViewType.Details, mainModel) { }
public LibraryGridView(DesktopAppViewModel mainModel) : base(ViewType.Grid, mainModel) { }
public MainViewAPI(DesktopAppViewModel mainModel) { this.mainModel = mainModel; }
public DetailsViewGameOverview(DesktopAppViewModel mainModel) : base(ViewType.Details, mainModel) { }
public GridViewGameOverview(DesktopAppViewModel mainModel) : base(ViewType.Grid, mainModel) { }
public TrayContextMenu(DesktopAppViewModel model) { mainModel = model; Opened += TrayContextMenu_Opened; }