Skip to content

Commit

Permalink
Implementing ViewModel interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike James committed Jun 17, 2016
1 parent e561c72 commit 2d144a9
Show file tree
Hide file tree
Showing 8 changed files with 312 additions and 178 deletions.
369 changes: 192 additions & 177 deletions BeerDrinkin_XamarinStudio.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C31319EA-8A83-4724-BA9A-DFB224016FB5}</ProjectGuid>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<UseMSBuildEngine>true</UseMSBuildEngine>
<OutputType>Library</OutputType>
<RootNamespace>BeerDrinkin.Core.Abstractions</RootNamespace>
<AssemblyName>BeerDrinkin.Core.Abstractions</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoStdLib>false</NoStdLib>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoStdLib>false</NoStdLib>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\ICheckInsViewModel.cs" />
<Compile Include="ViewModels\IDiscoverViewModel.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="ViewModels\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BeerDrinkin.Services.Abstractions\BeerDrinkin.Services.Abstractions.csproj">
<Project>{4FECE5FF-399C-4814-9830-E4D69D3AE83A}</Project>
<Name>BeerDrinkin.Services.Abstractions</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("BeerDrinkin.Core.Abstractions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xamarin")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Mike James 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using BeerDrinkin.DataObjects;

namespace BeerDrinkin.Core.Abstractions.ViewModels
{
public interface ICheckInsViewModel
{
Task<List<CheckIn>> Checkins(string userI);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using BeerDrinkin.DataObjects;
using System.IO;

namespace BeerDrinkin.Core.Abstractions.ViewModels
{
public interface IDiscoverViewModel
{
Task<List<Beer>> Search(string searchTerm);

Task<List<Beer>> TrendingBeers(int takecount);

Task<List<Beer>> LookupBarcode(string upc);

Task<List<Beer>> ImageLookup(Stream stream);
}
}

4 changes: 4 additions & 0 deletions ClientSDKs/BeerDrinkin.Core/BeerDrinkin.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
<Project>{4FECE5FF-399C-4814-9830-E4D69D3AE83A}</Project>
<Name>BeerDrinkin.Services.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\BeerDrinkin.Core.Abstractions\BeerDrinkin.Core.Abstractions.csproj">
<Project>{C31319EA-8A83-4724-BA9A-DFB224016FB5}</Project>
<Name>BeerDrinkin.Core.Abstractions</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
using System.Threading.Tasks;
using BeerDrinkin.Services.Abstractions;
using System.IO;
using BeerDrinkin.Core.Abstractions.ViewModels;

namespace BeerDrinkin.Core.ViewModels
{
public class DiscoverViewModel : ViewModelBase
public class DiscoverViewModel : ViewModelBase, IDiscoverViewModel
{
IAzureClient azure;
ISearchService searchService;
Expand Down
5 changes: 5 additions & 0 deletions ClientSDKs/BeerDrinkin.Core/ViewModels/ViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using BeerDrinkin.AzureClient;
using BeerDrinkin.DataStore.Azure;
using BeerDrinkin.Services.Abstractions;
using BeerDrinkin.Core.Abstractions.ViewModels;

namespace BeerDrinkin.Core.ViewModels
{
Expand All @@ -30,6 +31,10 @@ public static void Init()

ServiceLocator.Instance.Add<IStoreManager, StoreManager>();

//ViewModles
ServiceLocator.Instance.Add<ICheckInsViewModel, CheckInsViewModel>();
ServiceLocator.Instance.Add<IDiscoverViewModel, DiscoverViewModel>();

//TODO: Put this somewhere....
ServiceLocator.Instance.Resolve<IStoreManager>().InitializeAsync();
}
Expand Down

0 comments on commit 2d144a9

Please sign in to comment.