Skip to content

Commit

Permalink
Add minimal WPF sample (#325)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Schnerring <3743342+schnerring@users.noreply.github.com>
Co-authored-by: Chris Pulman <chris.pulman@yahoo.com>
Co-authored-by: Glenn <5834289+glennawatson@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 10, 2023
1 parent 017183b commit d6d3678
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Sample/SextantSample.WPF/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Application x:Class="SextantSample.WPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SextantSample.WPF"
StartupUri="MainWindow.xaml" />
6 changes: 6 additions & 0 deletions Sample/SextantSample.WPF/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace SextantSample.WPF
{
public partial class App
{
}
}
10 changes: 10 additions & 0 deletions Sample/SextantSample.WPF/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[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)
)]
8 changes: 8 additions & 0 deletions Sample/SextantSample.WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<wpf:FormsApplicationPage x:Class="SextantSample.WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wpf="clr-namespace:Xamarin.Forms.Platform.WPF;assembly=Xamarin.Forms.Platform.WPF"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800" />
15 changes: 15 additions & 0 deletions Sample/SextantSample.WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Xamarin.Forms;

namespace SextantSample.WPF
{
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();

Forms.Init();
LoadApplication(new SextantSample.App());
}
}
}
24 changes: 24 additions & 0 deletions Sample/SextantSample.WPF/SextantSample.WPF.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ReactiveUI.WPF" Version="13.0.38" />
<PackageReference Include="Xamarin.Forms.Platform.WPF" Version="4.8.0.1821" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SextantSample\SextantSample.csproj" />
</ItemGroup>

<!-- Workaround for Xamarin.Forms + WPF build issue -->
<!-- See also: https://github.com/xamarin/Xamarin.Forms/issues/13217 -->
<ItemGroup>
<EmbeddedResource Remove="**/*.xaml" />
</ItemGroup>

</Project>
33 changes: 32 additions & 1 deletion Sample/SextantSample.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31717.71
Expand All @@ -15,6 +14,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sextant.XamForms", "..\src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SextantSample.ViewModels", "SextantSample.Core\SextantSample.ViewModels.csproj", "{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SextantSample.WPF", "SextantSample.WPF\SextantSample.WPF.csproj", "{B3804254-BA2D-4ECF-9A71-8685843A546F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SextantSample.Maui", "SextantSample.Maui\SextantSample.Maui.csproj", "{7CABE10D-4CDE-4012-9385-6E49EE2E492F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libs", "Libs", "{637F2480-8306-4A3C-8E97-CB12D5FC3676}"
Expand Down Expand Up @@ -292,6 +293,36 @@ Global
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|iPhone.Build.0 = Release|Any CPU
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|iPhoneSimulator.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhone.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhone.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|Any CPU.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhone.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhone.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|Any CPU.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|Any CPU.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhone.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhone.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhoneSimulator.Build.0 = Release|Any CPU
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|x64.ActiveCfg = Release|x64
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|x64.Build.0 = Release|x64
{7CABE10D-4CDE-4012-9385-6E49EE2E492F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down

0 comments on commit d6d3678

Please sign in to comment.