public void DoubleClicked(RoutedEventArgs Args) { if (Args.FilterControlFromDoubleClick()) { return; } var vm = Args.FindListBoxItem <GameDataModel>(); if (vm != null) { DoubleClickedCommand.Execute(vm); } Args.Handled = true; }
protected override void OnInitialize() { base.OnInitialize(); var items = _mediator.Send(new ListGamesQuery()); items.EnableCollectionSynchronization(_itemsLock); Items = items; View = Items.SetupDefaultCollectionView( new[] { new SortDescription("IsInstalled", ListSortDirection.Descending), new SortDescription("IsFavorite", ListSortDirection.Descending), new SortDescription("Name", ListSortDirection.Ascending) }, new[] { new PropertyGroupDescription("IsInstalled") }, new[] { "IsInstalled" }, Filter, true); DoubleClickedCommand.Cast <GameDataModel>().Subscribe(ActivateGame); DomainEvilGlobal.SelectedGame.WhenAnyValue(x => x.ActiveGame) .Subscribe(ActivateGame); this.WhenAnyValue(x => x.ActiveGame) .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(x => SelectedItem = x); this.WhenAnyValue(x => x.SelectedItem) .Where(x => x != null) .Subscribe(x => { ContextMenu.ShowForItem(x); BarMenu.ShowForItem(x); }); UserSettings.WhenAnyValue(x => x.Ready) .Subscribe(x => ProgressState.Active = !x); UserSettings.WhenAnyValue(x => x.GameOptions.GameSettingsController.ActiveProfile) .Skip(1) .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(_ => HandleSettings()); this.WhenAnyValue(x => x.SelectedItem) .Skip(1) .Subscribe(HandleSettings); }