private async void IsSelectedPropertyChanged() { if (_animating) { return; } _animating = true; var start = IsSelected; if (IsSelected) { ForegroundView.Scale = BackgroundView.Scale; await ForegroundView.ScaleTo(0.92f, 100, easing : Easing.SpringOut); CheckmarkView.Scale = 0.8f; await Task.WhenAll(CheckmarkView.FadeTo(1, 80), CheckmarkView.ScaleTo(1f, 100, Easing.SpringOut)); } else { await Task.WhenAny(CheckmarkView.FadeTo(0, 60), ForegroundView.ScaleTo(1f, 80)); } _animating = false; if (start != IsSelected) { IsSelectedPropertyChanged(); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); this.Properties["bgStartup"] = false; if (e != null && e.Args.Count() > 0) { if (e.Args[0] == "-bg") { this.Properties["bgStartup"] = true; } } Configs configs = new Configs(); PresetFilters presets = new PresetFilters(); OrganisationSyncer organisationSyncer = new OrganisationSyncer(); TrayApp trayApp = new TrayApp(organisationSyncer, configs); Logger logger = new Logger(); BackgroundOrganiser backgroundOrganiser = new BackgroundOrganiser(new DirectoryModel()); ForegroundOrganiser foregroundOrganiser = new ForegroundOrganiser(new DirectoryModel()); BackgroundView backgroundView = new BackgroundView(); ForegroundView foregroundView = new ForegroundView(); DependencyFactory.Container.RegisterInstance <Configs>("configs", configs); DependencyFactory.Container.RegisterInstance <PresetFilters>("presets", presets); DependencyFactory.Container.RegisterInstance <OrganisationSyncer>("organisationSyncer", organisationSyncer); DependencyFactory.Container.RegisterInstance <BackgroundOrganiser>("backgroundOrganiser", backgroundOrganiser); DependencyFactory.Container.RegisterInstance <ForegroundOrganiser>("foregroundOrganiser", foregroundOrganiser); DependencyFactory.Container.RegisterType <BackgroundView>(); DependencyFactory.Container.RegisterType <ForegroundView>(); DependencyFactory.Container.RegisterType <PresetsView>(); DependencyFactory.Container.RegisterInstance <TrayApp>("trayApp", trayApp); DependencyFactory.Container.RegisterInstance <Logger>("logger", logger); }