New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From pair programming #1

Merged
merged 1 commit into from Dec 14, 2017
Jump to file or symbol
Failed to load files and symbols.
+136 −157
Diff settings

Always

Just for now

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.2.4.0.280\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.2.4.0.280\build\netstandard1.0\Xamarin.Forms.props')" />
<Import Project="..\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -91,26 +91,26 @@
<Reference Include="Xamarin.Android.Support.v7.MediaRouter">
<HintPath>..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.dll</HintPath>
</Reference>
<Reference Include="Plugin.Settings.Abstractions">
<HintPath>..\packages\Xam.Plugins.Settings.3.1.1\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Plugin.Settings">
<HintPath>..\packages\Xam.Plugins.Settings.3.1.1\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
</Reference>
<Reference Include="FormsViewGroup">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.Android">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Plugin.Settings.Abstractions">
<HintPath>..\packages\Xam.Plugins.Settings.3.1.1\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Plugin.Settings">
<HintPath>..\packages\Xam.Plugins.Settings.3.1.1\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -156,5 +156,5 @@
<Import Project="..\packages\Xamarin.Android.Support.v7.CardView.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.CardView.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.CardView.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.CardView.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v7.Palette.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Palette.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.Palette.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Palette.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.4.0.280\build\netstandard1.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.4.0.280\build\netstandard1.0\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.targets')" />
</Project>
View
@@ -17,5 +17,5 @@
<package id="Xamarin.Android.Support.v7.Palette" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.v7.RecyclerView" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Forms" version="2.4.0.280" targetFramework="monoandroid71" />
<package id="Xamarin.Forms" version="2.5.0.121934" targetFramework="monoandroid71" />
</packages>
View
@@ -1,5 +1,9 @@
using Xamarin.Forms;
using OnMyNerves.Views;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using System.Collections.Generic;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace OnMyNerves
{
public partial class App : Application
@@ -8,7 +12,22 @@ public App()
{
InitializeComponent();
MainPage = new OnMyNervesPage();
var settingsPage = new SettingsPage();
var settingsNav = new NavigationPage(settingsPage)
{
Icon = "settings.png"
};
var timerPage = new TimerPage();
var timerNav = new NavigationPage(timerPage)
{
Icon = "fabric.png"
};
var tabbed = new TabbedPage();
tabbed.Children.Add(settingsNav);
tabbed.Children.Add(timerNav);
MainPage = tabbed;
}
protected override void OnStart()
@@ -1,9 +1,10 @@
using System;
using System.ComponentModel;
using MvvmHelpers;
namespace OnMyNerves.Models
{
public class Fabric : INotifyPropertyChanged
public class Fabric : ObservableObject
{
private string name;
private int seconds;
@@ -14,38 +15,9 @@ public Fabric(string Name, int Seconds)
this.Seconds = Seconds;
}
public event PropertyChangedEventHandler PropertyChanged;
public string Name { get => name; set => SetProperty(ref name, value); }
public string Name
{
set
{
if (name != value)
{
name = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Name"));
}
}
get
{
return name;
}
}
public int Seconds
{
set
{
if (seconds != value)
{
seconds = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Seconds"));
}
}
get
{
return seconds;
}
}
public int Seconds { get => seconds; set => SetProperty(ref seconds, value); }
public override string ToString()
{
@@ -5,7 +5,6 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{04AE8FD5-92BF-4C94-9832-C787276196F9}</ProjectGuid>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<UseMSBuildEngine>true</UseMSBuildEngine>
<OutputType>Library</OutputType>
<RootNamespace>OnMyNerves</RootNamespace>
<AssemblyName>OnMyNerves</AssemblyName>
@@ -29,7 +28,6 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="App.xaml" />
<EmbeddedResource Include="OnMyNervesPage.xaml" />
<EmbeddedResource Include="Views\SettingsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
@@ -51,9 +49,6 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="OnMyNervesPage.xaml.cs">
<DependentUpon>OnMyNervesPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Views\MainTabbedPage.cs" />
<Compile Include="Views\SettingsPage.xaml.cs">
@@ -78,15 +73,6 @@
<Compile Include="Models\Fabric.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="MvvmHelpers">
<HintPath>..\packages\Refractored.MvvmHelpers.1.3.0\lib\netstandard1.0\MvvmHelpers.dll</HintPath>
</Reference>
@@ -96,6 +82,15 @@
<Reference Include="Plugin.Settings">
<HintPath>..\packages\Xam.Plugins.Settings.3.1.1\lib\netstandard1.0\Plugin.Settings.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -107,5 +102,5 @@
<Folder Include="Models\" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.2.4.0.280\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.4.0.280\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets')" />
</Project>

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,10 +1,33 @@
using System;
using OnMyNerves.Models;
using System.Collections.Generic;
namespace OnMyNerves.Services
{
public class FabricsDataService
{
public FabricsDataService()
{
}
public List<Fabric> GetAllFabrics()
{
throw new NotImplementedException();
}
public Fabric GetFabric(string name)
{
throw new NotImplementedException();
}
public void SaveFabric(Fabric f)
{
// Inserts into the Settings
// Or updates
// use this instead of settings!!
//Xamarin.Forms.Application.Current.Properties.
}
}
}
@@ -12,14 +12,21 @@ public class FabricDetailsViewModel : BaseViewModel
private INavigation Navigation;
public ICommand DoneEditingCommand { get; private set; }
private bool isNew = false;
public FabricDetailsViewModel(INavigation Navigation, Fabric Fabric)
{
this.Navigation = Navigation;
isNew = Fabric == null;
this.Fabric = Fabric;
DoneEditingCommand = new Command(DoneEditing);
}
private async void DoneEditing() {
private async void DoneEditing()
{
// use messaging center to alert fabric list view model of any changes
await Navigation.PopModalAsync();
}
@@ -18,6 +18,8 @@ public class FabricsListViewModel : BaseViewModel
public FabricsListViewModel(INavigation Navigation)
{
Title = "Fabrics List";
this.Navigation = Navigation;
AddFabricCommand = new Command(AddFabric);
@@ -26,11 +28,13 @@ public FabricsListViewModel(INavigation Navigation)
new Fabric("Test2", 5)};
}
private async void AddFabric() {
private async void AddFabric()
{
// TODO: Don't add a new fabric until details page saves
Fabric newFabric = new Fabric("", 60);
Fabrics.Add(newFabric);
await this.Navigation.PushModalAsync(new FabricDetailsPage(newFabric));
await this.Navigation.PushModalAsync(new NavigationPage(new FabricDetailsPage(newFabric)));
}
}
}
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="OnMyNerves.Views.FabricDetailsPage">
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="OnMyNerves.Views.FabricDetailsPage"
Title="{Binding Fabric.Name, Mode=TwoWay}">
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="errorStyle"
@@ -38,6 +42,7 @@
IsVisible="False"/>
</StackLayout>
<Button x:Name="DoneButton" Text="Done" FontSize="Large" Command="{Binding DoneEditingCommand}" HorizontalOptions="Center" VerticalOptions="End"/>
<Button Text="Cancel" FontSize="Large" Command="{Binding CancelEditingCommand}" HorizontalOptions="Center" VerticalOptions="End" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.