aboutsummaryrefslogtreecommitdiff
path: root/src/test/examples/WPFCoreMBA
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-04-29 19:36:24 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-04-29 19:53:29 +1000
commitae1751902076edfd8978b7fb42f24d3ac3f7ad55 (patch)
tree92011d854d8820cfd61136b7f6aa4378ba31b752 /src/test/examples/WPFCoreMBA
parenta79ce0b907676e50332139b4c4a8acb5d22a4b46 (diff)
downloadwix-ae1751902076edfd8978b7fb42f24d3ac3f7ad55.tar.gz
wix-ae1751902076edfd8978b7fb42f24d3ac3f7ad55.tar.bz2
wix-ae1751902076edfd8978b7fb42f24d3ac3f7ad55.zip
Add WPF .NET Core test.
Diffstat (limited to 'src/test/examples/WPFCoreMBA')
-rw-r--r--src/test/examples/WPFCoreMBA/AssemblyInfo.cs12
-rw-r--r--src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj16
-rw-r--r--src/test/examples/WPFCoreMBA/MainWindow.xaml16
-rw-r--r--src/test/examples/WPFCoreMBA/MainWindow.xaml.cs17
-rw-r--r--src/test/examples/WPFCoreMBA/WPFCoreBA.cs42
-rw-r--r--src/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs22
6 files changed, 125 insertions, 0 deletions
diff --git a/src/test/examples/WPFCoreMBA/AssemblyInfo.cs b/src/test/examples/WPFCoreMBA/AssemblyInfo.cs
new file mode 100644
index 00000000..03a5c7fa
--- /dev/null
+++ b/src/test/examples/WPFCoreMBA/AssemblyInfo.cs
@@ -0,0 +1,12 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3using System.Windows;
4
5[assembly:ThemeInfo(
6 ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
7 //(used if a resource is not found in the page,
8 // or application resource dictionaries)
9 ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
10 //(used if a resource is not found in the page,
11 // app, or any theme specific resource dictionaries)
12)]
diff --git a/src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj b/src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj
new file mode 100644
index 00000000..3b559f9b
--- /dev/null
+++ b/src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj
@@ -0,0 +1,16 @@
1<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2
3 <PropertyGroup>
4 <TargetFramework>netcoreapp3.1</TargetFramework>
5 <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
6 <EnableDynamicLoading>true</EnableDynamicLoading>
7 <Description>WPF .NET Core MBA</Description>
8 <UseWPF>true</UseWPF>
9 </PropertyGroup>
10
11
12 <ItemGroup>
13 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
14 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.19" />
15 </ItemGroup>
16</Project> \ No newline at end of file
diff --git a/src/test/examples/WPFCoreMBA/MainWindow.xaml b/src/test/examples/WPFCoreMBA/MainWindow.xaml
new file mode 100644
index 00000000..40a27a06
--- /dev/null
+++ b/src/test/examples/WPFCoreMBA/MainWindow.xaml
@@ -0,0 +1,16 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Window x:Class="Example.WPFCoreMBA.MainWindow"
6 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
7 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
8 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
9 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
10 xmlns:local="clr-namespace:Example.WPFCoreMBA"
11 mc:Ignorable="d"
12 Title="MainWindow" Height="450" Width="800">
13 <Grid>
14
15 </Grid>
16</Window>
diff --git a/src/test/examples/WPFCoreMBA/MainWindow.xaml.cs b/src/test/examples/WPFCoreMBA/MainWindow.xaml.cs
new file mode 100644
index 00000000..4f61b807
--- /dev/null
+++ b/src/test/examples/WPFCoreMBA/MainWindow.xaml.cs
@@ -0,0 +1,17 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace Example.WPFCoreMBA
4{
5 using System.Windows;
6
7 /// <summary>
8 /// Interaction logic for MainWindow.xaml
9 /// </summary>
10 public partial class MainWindow : Window
11 {
12 public MainWindow()
13 {
14 this.InitializeComponent();
15 }
16 }
17}
diff --git a/src/test/examples/WPFCoreMBA/WPFCoreBA.cs b/src/test/examples/WPFCoreMBA/WPFCoreBA.cs
new file mode 100644
index 00000000..d50be813
--- /dev/null
+++ b/src/test/examples/WPFCoreMBA/WPFCoreBA.cs
@@ -0,0 +1,42 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace Example.WPFCoreMBA
4{
5 using System.Windows.Threading;
6 using WixToolset.Mba.Core;
7
8 public class WPFCoreBA : BootstrapperApplication
9 {
10 public WPFCoreBA(IEngine engine)
11 : base(engine)
12 {
13 }
14
15 public Dispatcher BADispatcher { get; private set; }
16
17 protected override void Run()
18 {
19 this.BADispatcher = Dispatcher.CurrentDispatcher;
20 var window = new MainWindow();
21 window.Closed += (s, e) => this.BADispatcher.InvokeShutdown();
22 //window.Show();
23 //Dispatcher.Run();
24 //this.engine.Quit(0);
25 }
26
27 protected override void OnStartup(StartupEventArgs args)
28 {
29 base.OnStartup(args);
30
31 this.engine.Log(LogLevel.Standard, nameof(WPFCoreBA));
32 }
33
34 protected override void OnShutdown(ShutdownEventArgs args)
35 {
36 base.OnShutdown(args);
37
38 var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString();
39 this.engine.Log(LogLevel.Standard, message);
40 }
41 }
42}
diff --git a/src/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs b/src/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs
new file mode 100644
index 00000000..a3ccdf9f
--- /dev/null
+++ b/src/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs
@@ -0,0 +1,22 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3[assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.WPFCoreMBA.WPFCoreBAFactory))]
4namespace Example.WPFCoreMBA
5{
6 using WixToolset.Mba.Core;
7
8 public class WPFCoreBAFactory : BaseBootstrapperApplicationFactory
9 {
10 private static int loadCount = 0;
11
12 protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand)
13 {
14 if (loadCount > 0)
15 {
16 engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)");
17 }
18 ++loadCount;
19 return new WPFCoreBA(engine);
20 }
21 }
22}