Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Added Windows Desktop (WPF) platform implementation #1079

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0cbb71c
Added WPF/Win32 platform implementation for key features.
peterfoot Feb 2, 2020
9917325
Added device, display and speech implementations. Added WPF sample ap…
peterfoot Feb 3, 2020
eed2900
Preferences persisted to file. Email provider added
peterfoot Feb 4, 2020
7bec9af
Removed Json.NET dependency and used BinarySerializer to store prefer…
peterfoot Feb 18, 2020
a9f4c40
Improved preferences following feedback
peterfoot Feb 19, 2020
a132e57
Added Maps and Geolocation. Serialization improvements to Preferences
peterfoot Feb 27, 2020
41f2cad
Added phonedialer support for completeness
peterfoot Feb 29, 2020
9783b27
Changed preferences serialization to Json. Added SecureStorage for Win32
peterfoot Apr 15, 2020
9f6173a
Code clean up
peterfoot Apr 15, 2020
00937e5
added Win32 placeholder
peterfoot May 31, 2020
70dd965
Merge branch 'pr/2'
peterfoot May 31, 2020
ac76c66
Win32 now App theme aware
peterfoot May 31, 2020
25d8fb6
Fix for breaking change to Utils
peterfoot May 31, 2020
f7b03c6
merged latest main
peterfoot Oct 9, 2020
552626f
reworked against latest main branch.
peterfoot Oct 9, 2020
3873ede
changed IsSupported to throw for consistency
peterfoot Oct 9, 2020
8cfcd2e
Reference consistent version of Xamarin Forms. Correct project link t…
peterfoot Oct 9, 2020
aab19bb
Added Win32 FilePicker. Added support for FilePicker in the Sample ap…
peterfoot Oct 9, 2020
01faa59
Added a basic Sms provider for Win32 using an sms: uri which will lau…
peterfoot Oct 10, 2020
aa3d1bf
Screenshot commit, added charset attribute value
Oct 10, 2020
80a6fc7
Merge pull request #3 from Mrnikbobjeff/WPF
peterfoot Oct 10, 2020
c1335ca
Added IsSupported checks
Oct 11, 2020
dd0b44b
Merge pull request #4 from Mrnikbobjeff/WPF
peterfoot Oct 11, 2020
b1ba61f
Cleared code formatting error
peterfoot Oct 18, 2020
bed4929
Merge branch 'main' into master
peterfoot Oct 18, 2020
857dc87
Fix IsSupported to throw expected exception
peterfoot Oct 18, 2020
9b9be61
Merge branch 'master' of https://github.com/inthehand/Essentials
peterfoot Oct 18, 2020
c03c6bf
Merge branch 'main' of https://github.com/xamarin/Essentials into main
peterfoot Nov 12, 2020
307559e
merged
peterfoot Nov 12, 2020
d8e4ed5
Fixed FilePickerFileTypes and added new ones to the Win32 implementation
peterfoot Nov 24, 2020
01a36d0
MainThread supports both WinForms and WPF and can detect which is cur…
peterfoot Nov 24, 2020
a0ae8ed
Fixed build warnings (macOS API change)
peterfoot Nov 24, 2020
c4969ea
Added WinForms sample
peterfoot Jul 13, 2021
c885c9a
merged latest
peterfoot Jul 13, 2021
4a857a3
fixed XF reference in WPF sample
peterfoot Jul 13, 2021
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 Samples/Samples.WPF/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.1" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions Samples/Samples.WPF/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="Samples.WPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Samples.WPF"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions Samples/Samples.WPF/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace Samples.WPF
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
4 changes: 4 additions & 0 deletions Samples/Samples.WPF/FileSystemTemplate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This file was loaded from the app package.

You can use this as a starting point for your comments...

13 changes: 13 additions & 0 deletions Samples/Samples.WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<wpf:FormsApplicationPage x:Class="Samples.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"
xmlns:local="clr-namespace:Samples.WPF"
mc:Ignorable="d"
Title="Samples" Height="600" Width="800">
<Grid>

</Grid>
</wpf:FormsApplicationPage>
33 changes: 33 additions & 0 deletions Samples/Samples.WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Xamarin.Forms;
using Xamarin.Forms.Platform.WPF;

namespace Samples.WPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : FormsApplicationPage
{
public MainWindow()
{
InitializeComponent();
Forms.Init();

LoadApplication(new Samples.App());
}
}
}
39 changes: 39 additions & 0 deletions Samples/Samples.WPF/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
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("Samples.WPF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Samples")]
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
[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)]

[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly)]

// 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")]
71 changes: 71 additions & 0 deletions Samples/Samples.WPF/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 117 additions & 0 deletions Samples/Samples.WPF/Properties/Resources.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
30 changes: 30 additions & 0 deletions Samples/Samples.WPF/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Samples/Samples.WPF/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
Loading