public YoutubeDownloaderViewModel CreateViewModel(ArgumentCollection args = null) { ArgumentCollection requiredArgs = this.GetRequiredViewModelArgs(); requiredArgs.Set(args); return(base.CreateViewModel <YoutubeDownloaderViewModel>(requiredArgs)); }
public ComputerPerformanceViewModel CreateViewModel(ArgumentCollection args = null) { ArgumentCollection requiredArgs = this.GetRequiredViewModelArgs(); requiredArgs.Set(args); return(base.CreateViewModel <ComputerPerformanceViewModel>(requiredArgs)); }
public ArgumentCollection GetRequiredViewModelArgs() { ArgumentCollection args = new ArgumentCollection(); args.Set(ArgumentCollection.ArgumentType.Downloader, new Downloader()); return(args); }
public virtual T CreateViewModel <T>(ArgumentCollection args) where T : IViewModel, new() { T item = (T)Activator.CreateInstance(typeof(T)); item.Initialize(args); return(item); }
public static YoutubeDownloaderViewModel InitilizeViewModel() { MockDownloader downloader = new MockDownloader(); ArgumentCollection args = new ArgumentCollection(); args.Set(ArgumentCollection.ArgumentType.Downloader, downloader); return(Common.CreateYoutubeDownloaderViewModel(args) as YoutubeDownloaderViewModel); }
private void Initialize(ArgumentCollection args) { try { this.propertyChangedEventHandler = new PropertyChangedEventHandler(this.ChangeListener); ViewModelFactory factory = new ViewModelFactory(); this.viewModel = factory.CreateViewModel <BaseWindowViewModel>(args); this.DataContext = viewModel; this.ManagePropertyChangeNotificationSubscription(this.Content as Visual, PropertyChangeNotificationOperation.Subscribe); } catch (Exception ex) { Logger.Logger.Log(EventID.WPFCommonControls.Application.Exception, "InitializeBaseWindow", ex); } }
protected override void OnStartup(StartupEventArgs e) { Stopwatch sw = new Stopwatch(); try { sw.Start(); Logger.Log(EventID.DIStickyNotes.Application.StartupEnter); base.OnStartup(e); ArgumentCollection args = new ArgumentCollection(); plugin.InitializePlugin(args); plugin.GetPluginWindow()?.Show(); } catch (Exception ex) { Logger.Log(EventID.DIStickyNotes.Application.Exception, nameof(OnStartup), ex); } finally { sw.Stop(); Logger.Log(EventID.DIStickyNotes.Application.StartupExit, sw.ElapsedMilliseconds); } }
public BaseWindow(ArgumentCollection args) { InitializeComponent(); this.Initialize(args); }
public static IViewModel CreateYoutubeDownloaderViewModel(ArgumentCollection args = null) { return(new YoutubeDownloaderViewModelFactory().CreateViewModel(args: args)); }