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

Update supported platforms #7

Merged
merged 8 commits into from
Nov 8, 2018
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
78 changes: 78 additions & 0 deletions Bxf.Pcl_111/Bxf.Pcl_111.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{67F9D3A8-F71E-4428-913F-C37AE82CDB24}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Bxf</RootNamespace>
<AssemblyName>Bxf</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile111</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;XAMARIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Bin\Release\PCL_111\</OutputPath>
<DefineConstants>TRACE;XAMARIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\Bin\Release\PCL_111\Bxf.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>BxfKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.3.4.247\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.3.4.247\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.2.3.4.247\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="BxfKey.snk" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\Bxf.Shared\Bxf.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets'))" />
</Target>
<!-- 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>
Binary file added Bxf.Pcl_111/BxfKey.snk
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
using System.Reflection;
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 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("UsingBxfNav")]
[assembly: AssemblyTitle("Bxf.Pcl_111")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("UsingBxfNav")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Bxf.Pcl_111")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[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)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8e85635d-a360-489d-9aad-f3fa8d665d84")]
[assembly: NeutralResourcesLanguage("en")]

// Version information for an assembly consists of the following four values:
//
Expand All @@ -29,7 +23,8 @@
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// 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")]
4 changes: 4 additions & 0 deletions Bxf.Pcl_111/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Forms" version="2.3.4.247" targetFramework="portable45-net45+win8+wpa81" />
</packages>
4 changes: 3 additions & 1 deletion Bxf.Shared/Converters/NotConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if !XAMARIN
using System;
#if WINDOWS_UWP
using Windows.UI.Xaml.Data;
#else
Expand Down Expand Up @@ -60,3 +61,4 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste
}
}
}
#endif
4 changes: 3 additions & 1 deletion Bxf.Shared/Converters/VisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if !XAMARIN
using System;
#if WINDOWS_UWP
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml;
Expand Down Expand Up @@ -72,3 +73,4 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste
}
}
}
#endif
6 changes: 6 additions & 0 deletions Bxf.Shared/IView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#if WINDOWS_UWP
using Windows.UI.Xaml.Controls;
#elif XAMARIN
using Xamarin.Forms;
#else
using System.Windows.Controls;
#endif
Expand All @@ -15,7 +17,11 @@ public interface IView
/// <summary>
/// Gets the instance of the view.
/// </summary>
#if XAMARIN
VisualElement ViewInstance { get; }
#else
UserControl ViewInstance { get; }
#endif
/// <summary>
/// Gets the name of the view used to create
/// the view instance by the view factory.
Expand Down
9 changes: 0 additions & 9 deletions Bxf.Shared/IViewFactory.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#if WINDOWS_UWP
using Windows.UI.Xaml.Controls;
#else
using System.Windows.Controls;
#endif

namespace Bxf
{
/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion Bxf.Shared/ModelManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if WINDOWS_UWP
#if !XAMARIN
#if WINDOWS_UWP
using Windows.UI.Xaml;
#else
using System.Windows;
Expand Down Expand Up @@ -28,3 +29,4 @@ public object Data
}
}
}
#endif
8 changes: 7 additions & 1 deletion Bxf.Shared/Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#if WINDOWS_UWP
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
#else
#elif !XAMARIN
using System.Windows.Controls;
using System.Windows.Data;
using System.ComponentModel;
Expand Down Expand Up @@ -125,8 +125,13 @@ protected virtual void InitializeBindingResource(IView view)
{
if (string.IsNullOrEmpty(view.BindingResourceKey))
{
#if XAMARIN
form.BindingContext = view.Model;
#else
form.DataContext = view.Model;
#endif
}
#if !XAMARIN
else
{
var resource = form.Resources[view.BindingResourceKey];
Expand Down Expand Up @@ -155,6 +160,7 @@ protected virtual void InitializeBindingResource(IView view)
}
}
}
#endif
}
}

Expand Down
6 changes: 6 additions & 0 deletions Bxf.Shared/Status.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#if WINDOWS_UWP
using Windows.UI.Xaml;
#elif XAMARIN
using Xamarin.Forms;
#else
using System.Windows;
#endif
Expand Down Expand Up @@ -48,6 +50,10 @@ public Status()
/// This is optional.
/// </remarks>
/// <value>The visual element.</value>
#if XAMARIN
public VisualElement Visual { get; set; }
#else
public FrameworkElement Visual { get; set; }
#endif
}
}
10 changes: 10 additions & 0 deletions Bxf.Shared/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.Text;
#if WINDOWS_UWP
using Windows.UI.Xaml.Controls;
#elif XAMARIN
using Xamarin.Forms;
#else
using System.Windows.Controls;
#endif
Expand All @@ -24,7 +26,11 @@ public class View : IView
/// <param name="view">Instance of the view.</param>
/// <param name="bindingResourceKey">Name of the binding resource.</param>
/// <param name="model">Instance of the model or viewmodel for the view.</param>
#if XAMARIN
public View(string viewName, VisualElement view, string bindingResourceKey, object model)
#else
public View(string viewName, UserControl view, string bindingResourceKey, object model)
#endif
{
ViewInstance = view;
ViewName = viewName;
Expand All @@ -35,7 +41,11 @@ public View(string viewName, UserControl view, string bindingResourceKey, object
/// <summary>
/// Gets the instance of the view.
/// </summary>
#if XAMARIN
public VisualElement ViewInstance { get; private set; }
#else
public UserControl ViewInstance { get; private set; }
#endif
/// <summary>
/// Gets the name of the view used to create
/// the view instance by the view factory.
Expand Down
21 changes: 13 additions & 8 deletions Bxf.Shared/ViewFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.Text;
#if WINDOWS_UWP
using Windows.UI.Xaml.Controls;
#elif XAMARIN
using Xamarin.Forms;
#else
using System.Windows.Controls;
#endif
Expand Down Expand Up @@ -32,29 +34,32 @@ public virtual IView GetView(string viewName, string bindingResourceKey, object
/// Creates an instance of the view.
/// </summary>
/// <param name="viewName">Name of the view.</param>
#if XAMARIN
protected virtual VisualElement CreateUserControl(string viewName)
#else
protected virtual UserControl CreateUserControl(string viewName)
#endif
{
if (string.IsNullOrEmpty(viewName))
return null;

var t = GetType(viewName);
if (t == null)
throw new ArgumentException(string.Format("viewName ({0})", viewName));
#if XAMARIN
return (VisualElement)Activator.CreateInstance(t);
#else
return (UserControl)Activator.CreateInstance(t);
#endif
}

private static Type GetType(string typeName)
{
string fullTypeName;
#if SILVERLIGHT
if (typeName.Contains("Version="))
fullTypeName = typeName;
else
fullTypeName = typeName + ", Version=..., Culture=neutral, PublicKeyToken=null";
#if XAMARIN
return Type.GetType(typeName, true);
#else
fullTypeName = typeName;
return Type.GetType(typeName, true, false);
#endif
return Type.GetType(fullTypeName, true, false);
}
}
}
6 changes: 4 additions & 2 deletions Bxf.Shared/Xaml/ExecuteEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//-----------------------------------------------------------------------
#if !XAMARIN
//-----------------------------------------------------------------------
// <copyright file="ExecuteEventArgs.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: http://www.lhotka.net/cslanet/
Expand Down Expand Up @@ -36,4 +37,5 @@ public class ExecuteEventArgs : EventArgs
/// </summary>
public object TriggerParameter { get; set; }
}
}
}
#endif
6 changes: 4 additions & 2 deletions Bxf.Shared/Xaml/TriggerAction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//-----------------------------------------------------------------------
#if !XAMARIN
//-----------------------------------------------------------------------
// <copyright file="TriggerAction.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: http://www.lhotka.net/cslanet/
Expand Down Expand Up @@ -304,4 +305,5 @@ private static Binding CopyBinding(Binding oldBinding)

#endregion
}
}
}
#endif
Loading