-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
79 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace ReactViewControl { | ||
|
||
public interface IViewModule { | ||
|
||
public string MainJsSource { get; } | ||
|
||
IModuleDependenciesProvider DependenciesProvider{ get; set; } | ||
|
||
string[] DependencyJsSources { get; } | ||
|
||
string[] CssSources { get; } | ||
|
||
string NativeObjectName { get; } | ||
|
||
string Name { get; } | ||
|
||
string Source { get; } | ||
|
||
object CreateNativeObject(); | ||
|
||
string[] Events { get; } | ||
|
||
KeyValuePair<string, object>[] PropertiesValues { get; } | ||
|
||
void Bind(IFrame frame, IChildViewHost host = null); | ||
|
||
event CustomResourceRequestedEventHandler CustomResourceRequested; | ||
|
||
T WithPlugin<T>(); | ||
|
||
void Load(); | ||
|
||
bool AddChildView(IViewModule childView, string frameName); | ||
|
||
T GetOrAddChildView<T>(string frameName) where T : IViewModule, new(); | ||
|
||
ReactView Host { get; } | ||
} | ||
} | ||
using System.Collections.Generic; | ||
|
||
namespace ReactViewControl { | ||
|
||
public interface IViewModule { | ||
|
||
public string MainJsSource { get; } | ||
|
||
IModuleDependenciesProvider DependenciesProvider{ get; set; } | ||
|
||
string[] DependencyJsSources { get; } | ||
|
||
string[] CssSources { get; } | ||
|
||
string NativeObjectName { get; } | ||
|
||
string Name { get; } | ||
|
||
string Source { get; } | ||
|
||
object CreateNativeObject(); | ||
|
||
string[] Events { get; } | ||
|
||
KeyValuePair<string, object>[] PropertiesValues { get; } | ||
|
||
void Bind(IFrame frame, IChildViewHost host = null); | ||
|
||
event CustomResourceRequestedEventHandler CustomResourceRequested; | ||
|
||
T WithPlugin<T>(); | ||
|
||
void Load(); | ||
|
||
bool AddChildView(IViewModule childView, string frameName); | ||
|
||
T GetOrAddChildView<T>(string frameName) where T : IViewModule, new(); | ||
|
||
ReactView Host { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
using System; | ||
using ReactViewControl; | ||
using WebViewControl; | ||
|
||
namespace Sample.Avalonia { | ||
|
||
internal class ExtendedReactViewFactory : ReactViewFactory { | ||
private static WebPackDependenciesProvider provider = new WebPackDependenciesProvider(new Uri("http://localhost:8080/Sample.Avalonia/")); | ||
|
||
public override ResourceUrl DefaultStyleSheet => | ||
new ResourceUrl(typeof(ExtendedReactViewFactory).Assembly, "Generated", Settings.IsLightTheme ? "LightTheme.css" : "DarkTheme.css"); | ||
|
||
public override IViewModule[] InitializePlugins() { | ||
var viewPlugin = new ViewPlugin(); | ||
#if DEBUG | ||
if (DevServerURI != null) { | ||
viewPlugin.DependenciesProvider = ModuleDependenciesProvider; | ||
} | ||
#endif | ||
return new[]{ | ||
viewPlugin | ||
}; | ||
} | ||
|
||
public override bool ShowDeveloperTools => false; | ||
|
||
public override bool EnableViewPreload => true; | ||
|
||
#if DEBUG | ||
public override bool EnableDebugMode => true; | ||
|
||
public override Uri DevServerURI => new Uri("http://localhost:8080/Sample.Avalonia/"); | ||
|
||
public override IModuleDependenciesProvider ModuleDependenciesProvider => | ||
provider; | ||
#endif | ||
} | ||
} | ||
using System; | ||
using ReactViewControl; | ||
using WebViewControl; | ||
|
||
namespace Sample.Avalonia { | ||
|
||
internal class ExtendedReactViewFactory : ReactViewFactory { | ||
private static WebPackDependenciesProvider provider = new WebPackDependenciesProvider(new Uri("http://localhost:8080/Sample.Avalonia/")); | ||
|
||
public override ResourceUrl DefaultStyleSheet => | ||
new ResourceUrl(typeof(ExtendedReactViewFactory).Assembly, "Generated", Settings.IsLightTheme ? "LightTheme.css" : "DarkTheme.css"); | ||
|
||
public override IViewModule[] InitializePlugins() { | ||
var viewPlugin = new ViewPlugin(); | ||
#if DEBUG | ||
if (DevServerURI != null) { | ||
viewPlugin.DependenciesProvider = ModuleDependenciesProvider; | ||
} | ||
#endif | ||
return new[]{ | ||
viewPlugin | ||
}; | ||
} | ||
|
||
public override bool ShowDeveloperTools => false; | ||
|
||
public override bool EnableViewPreload => true; | ||
|
||
#if DEBUG | ||
public override bool EnableDebugMode => true; | ||
|
||
public override Uri DevServerURI => new Uri("http://localhost:8080/Sample.Avalonia/"); | ||
|
||
public override IModuleDependenciesProvider ModuleDependenciesProvider => | ||
provider; | ||
#endif | ||
} | ||
} |