Skip to content

Use ints for XAML Enums #36

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

Merged
merged 3 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ NativeXamlControl,
MenuFlyoutItem,
TextBox,
// BlankUserControl,
ClickMode,
} from 'react-native-xaml'; // Would be from 'react-native-xaml' outside of this repo;

const Section = ({children, title}): Node => {
Expand Down Expand Up @@ -84,7 +85,9 @@ const App: () => Node = () => {
}}>
{/* <BlankUserControl onHappened={(arg) => alert(JSON.stringify(arg.nativeEvent)) } /> */}
<Button content={{ string: `Last selected option = ${option} ${count}` }} foreground="red"
onClick={(a) => { alert(JSON.stringify(a.nativeEvent)); setCount(count + 1); setIsOpen(true); }} />
onClick={(a) => { alert(JSON.stringify(a.nativeEvent)); setCount(count + 1); setIsOpen(true); }}
clickMode={ClickMode.Release}
/>
{/*<StackPanel orientation="horizontal">*/}
{/* <HyperlinkButton content={{ string: "Click me!" }} onClick={(args) => {*/}
{/* alert(`clicked! Native event args: ${JSON.stringify(args.nativeEvent)}`);*/}
Expand Down
8 changes: 4 additions & 4 deletions package/Codegen/Codegen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
</ItemGroup>

<ItemGroup>
<Compile Update="EnumConverters.cs">
<Compile Update="TSEnums.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>EnumConverters.tt</DependentUpon>
<DependentUpon>TSEnums.tt</DependentUpon>
</Compile>
<Compile Update="TSProps.cs">
<DesignTime>True</DesignTime>
Expand Down Expand Up @@ -48,9 +48,9 @@
</ItemGroup>

<ItemGroup>
<None Update="EnumConverters.tt">
<None Update="TSEnums.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>EnumConverters.cs</LastGenOutput>
<LastGenOutput>TSEnums.cs</LastGenOutput>
</None>
<None Update="TSProps.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
Expand Down
40 changes: 0 additions & 40 deletions package/Codegen/EnumConverters.tt

This file was deleted.

4 changes: 2 additions & 2 deletions package/Codegen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ private void DumpTypes()
var propertiesGen = new TypeProperties(properties).TransformText();
UpdateFile(Path.Join(generatedDirPath, "TypeProperties.g.h"), propertiesGen);

var enumConvertersGen = new EnumConverters().TransformText();
UpdateFile(Path.Join(generatedDirPath, "EnumConverters.g.cpp"), enumConvertersGen);
var tsEnumsGen = new TSEnums().TransformText();
UpdateFile(Path.Join(packageSrcPath, "Enums.ts"), tsEnumsGen);

var eventsGen = new TypeEvents(events).TransformText();
UpdateFile(Path.Join(generatedDirPath, "TypeEvents.g.h"), eventsGen);
Expand Down
Loading