Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Net46 Playground Application #868

Merged
merged 36 commits into from
Nov 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
88370b1
Syncing with upstream
pre10der89 Oct 31, 2016
f84414a
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Oct 31, 2016
03ced95
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Oct 31, 2016
06f707e
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 1, 2016
4a27072
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 1, 2016
95e155d
Adding shell/MainReactPackage to ReactNative.Net46
pre10der89 Nov 1, 2016
a468c89
Adding Playground.Net46 WPF application with basic ReactNative integr…
pre10der89 Nov 1, 2016
d0665a7
Added a bootstrapper for initializing the ReactPage and the applicati…
pre10der89 Nov 2, 2016
32a32a8
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 2, 2016
0182bf4
Reverting the Examples to the previous version
pre10der89 Nov 2, 2016
c14d959
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 2, 2016
08f2fed
* Restyling Net46 RedBoxDialog and ProgressDialog to fit WPF styling...
pre10der89 Nov 3, 2016
f9f14d2
Merge branch 'master' of https://github.com/pre10der89/react-native-w…
pre10der89 Nov 3, 2016
20e5573
* Moving Progress Design Data to its own file... Renaming existing de…
pre10der89 Nov 3, 2016
6abdbd4
* Implemented a mouse accelerator to invoke the developer support fea…
pre10der89 Nov 5, 2016
826f389
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 5, 2016
d882809
Merge branch 'master' of https://github.com/pre10der89/react-native-w…
pre10der89 Nov 5, 2016
e21fade
* Set RootView to be Focusable and its FocusVisualStyle to null and e…
pre10der89 Nov 8, 2016
f30bd7f
Fixing random issues everywhere...
pre10der89 Nov 8, 2016
d3ca586
Fixing Touch point issues
pre10der89 Nov 8, 2016
7cdbd8b
Final debugging of Playground.Net46 App
pre10der89 Nov 9, 2016
6867174
code cleanup
kevinvangelder Nov 9, 2016
de556c9
upgraded nuget package and implemented websocket module
kevinvangelder Nov 9, 2016
63f0152
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 9, 2016
496aebc
Merge branch 'master' of https://github.com/pre10der89/react-native-w…
pre10der89 Nov 9, 2016
4c2514f
Merge branch 'playground-net46' of https://github.com/pre10der89/reac…
pre10der89 Nov 9, 2016
42ea822
Fixing failing tests on dispatcher null reference
pre10der89 Nov 9, 2016
e9ae10d
Migrated WebSocketModuleTests to Shared.Tests, Fixed Net46 WebSocketM…
pre10der89 Nov 9, 2016
ebbfd7a
Applying changes requeted in PR #868
pre10der89 Nov 10, 2016
ac60c27
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 11, 2016
5331481
Merge branch 'master' of https://github.com/pre10der89/react-native-w…
pre10der89 Nov 11, 2016
7a3a24a
Fixing race condition between the main window and the progress dialog…
pre10der89 Nov 11, 2016
0350892
Correcting incorrect comment
pre10der89 Nov 11, 2016
346eda9
Adding fixes/changes from Pull Request code review...
pre10der89 Nov 14, 2016
9947873
Merge branch 'master' of https://github.com/ReactWindows/react-native…
pre10der89 Nov 14, 2016
5e1b14d
Merge branch 'master' of https://github.com/pre10der89/react-native-w…
pre10der89 Nov 14, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ReactWindows/Playground.Net46/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
</configuration>
5 changes: 5 additions & 0 deletions ReactWindows/Playground.Net46/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Application x:Class="Playground.Net46.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

</Application>
101 changes: 101 additions & 0 deletions ReactWindows/Playground.Net46/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;

namespace Playground.Net46
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
{
private readonly AppReactPage _reactPage = new AppReactPage();

/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
}

/// <summary>
/// Override method fired prior to the Startup event when the Run method of the Application object is called...
/// </summary>
/// <param name="e"></param>
protected override void OnStartup(StartupEventArgs e)
Copy link
Collaborator

@rozele rozele Nov 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OnStartup [](start = 32, length = 9)

add docs to protected methods #Closed

{
base.OnStartup(e);
OnCreate(e.Args);
}

/// <summary>
/// Called whenever the app is opened to initialized...
/// </summary>
/// <param name="arguments"></param>
private void OnCreate(string[] arguments)
{
var shellWindow = Application.Current.MainWindow;

if (shellWindow == null)
{
shellWindow = new Window
{
ShowActivated = true,
ShowInTaskbar = true,
Title = "Playground.Net46",
Height = 768,
Width = 1024,
WindowStartupLocation = WindowStartupLocation.CenterScreen
};

Application.Current.MainWindow = shellWindow;
}

//Show Window if it is not already active...
if (!shellWindow.IsLoaded)
{
shellWindow.Show();
}

var rootFrame = shellWindow.Content as Frame;

// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
_reactPage.OnCreate(arguments);

// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();

rootFrame.NavigationFailed += OnNavigationFailed;

// Place the frame in the current Window
shellWindow.Content = rootFrame;
}

if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Content = _reactPage;
}

// Ensure the current window is active
shellWindow.Activate();
}

/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page...");
}
}
}
41 changes: 41 additions & 0 deletions ReactWindows/Playground.Net46/AppReactPage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using ReactNative;
using ReactNative.Modules.Core;
using ReactNative.Shell;
using System.Collections.Generic;

namespace Playground.Net46
{
internal class AppReactPage : ReactPage
{
public override string MainComponentName => "Playground.Net46";

public override string JavaScriptMainModuleName => "ReactWindows/Playground.Net46/index.windows";

#if BUNDLE
public override string JavaScriptBundleFile
{
get
{
return "ms-appx:///ReactAssets/index.windows.bundle";
}
}
#endif

public override List<IReactPackage> Packages => new List<IReactPackage>
{
new MainReactPackage(),
};

public override bool UseDeveloperSupport
{
get
{
#if !BUNDLE || DEBUG
return true;
#else
return false;
#endif
}
}
}
}
126 changes: 126 additions & 0 deletions ReactWindows/Playground.Net46/Playground.Net46.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7AB3A24A-D5D9-479F-8E12-22213DD40D3F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Playground.Net46</RootNamespace>
<AssemblyName>Playground.Net46</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET46</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NET46</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="AppReactPage.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ReactNative.Net46\ReactNative.Net46.csproj">
<Project>{22cbff9c-fe36-43e8-a246-266c7635e662}</Project>
<Name>ReactNative.Net46</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<ItemGroup>
<ChakraCoreDll Include="$(SolutionDir)..\ChakraCore\Build\VcBuild\bin\$(Platform)_$(Configuration)\ChakraCore.*" />
</ItemGroup>
<Copy SourceFiles="@(ChakraCoreDll)" DestinationFolder="$(OutputPath)" ContinueOnError="false" />
</Target>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
53 changes: 53 additions & 0 deletions ReactWindows/Playground.Net46/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Playground.Net46")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Playground.Net46")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
56 changes: 56 additions & 0 deletions ReactWindows/Playground.Net46/index.windows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/

import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
} from 'react-native';

class Playground extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.windows.js
</Text>
<Text style={styles.instructions}>
Press Ctrl+R to reload
</Text>
<Text style={styles.instructions}>
Press Ctrl+D or Ctrl+M for dev menu
</Text>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
width: 500
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
width: 500
},
});

AppRegistry.registerComponent('Playground.Net46', () => Playground);
Loading