public static void AddPluginsMvc( this IServiceCollection services, IThemeInfoProvider themeInfoProvider, string basePath) { services.AddPluginsMvc( new ThemeViewLocationExpander(themeInfoProvider, basePath)); }
public WebBrowserWidget(IThemeInfoProvider themeInfo) { this.Parameters = new WebBrowserParameters(); this.themeInfo = themeInfo; this.viewModel = new WebBrowserViewModel((WebBrowserParameters)this.Parameters); this.UiElement = new WebBrowserView(); this.UiElement.DataContext = this.viewModel; this.ChangeTheme(this.themeInfo.CurrentTheme); this.themeInfo.ThemeChangedEvent += new EventHandler <ThemeChangedEventArgs>(this.ThemeChanged); }
/// <summary> /// Initializes a new instance of the <see cref="ThemeViewLocationExpander"/> class. /// </summary> /// <param name="basePath"></param> /// <param name="themeInfoProvider"></param> public ThemeViewLocationExpander( IThemeInfoProvider themeInfoProvider, string basePath) { this._themeInfoProvider = themeInfoProvider; if (Path.IsPathRooted(basePath)) { throw new NotImplementedException( "Support for absolute pathes is not yet implemeted"); } else { basePath = basePath .Replace("./", "~/") .RemoveTrailingSlash(); this._template1 = $"{basePath}/{{0}}/Views/{{{{1}}}}/{{{{0}}}}.cshtml"; this._template2 = $"{basePath}/{{0}}/Views/Shared/{{{{0}}}}.cshtml"; } }
public WebBrowserPlugin(IThemeInfoProvider themeInfo) { this.themeInfo = themeInfo; this.Parameters = new WebBrowserParameters(); }