-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made some progress, we can load the main view
- Loading branch information
1 parent
63bc6eb
commit e33d05a
Showing
34 changed files
with
1,361 additions
and
6 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,55 @@ | |||
using System; | |||
using System.ComponentModel; | |||
using System.Runtime.CompilerServices; | |||
using Windows.UI.Xaml.Data; | |||
|
|||
namespace Play.Common | |||
{ | |||
/// <summary> | |||
/// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models. | |||
/// </summary> | |||
[Windows.Foundation.Metadata.WebHostHidden] | |||
public abstract class BindableBase : INotifyPropertyChanged | |||
{ | |||
/// <summary> | |||
/// Multicast event for property change notifications. | |||
/// </summary> | |||
public event PropertyChangedEventHandler PropertyChanged; | |||
|
|||
/// <summary> | |||
/// Checks if a property already matches a desired value. Sets the property and | |||
/// notifies listeners only when necessary. | |||
/// </summary> | |||
/// <typeparam name="T">Type of the property.</typeparam> | |||
/// <param name="storage">Reference to a property with both getter and setter.</param> | |||
/// <param name="value">Desired value for the property.</param> | |||
/// <param name="propertyName">Name of the property used to notify listeners. This | |||
/// value is optional and can be provided automatically when invoked from compilers that | |||
/// support CallerMemberName.</param> | |||
/// <returns>True if the value was changed, false if the existing value matched the | |||
/// desired value.</returns> | |||
protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] String propertyName = null) | |||
{ | |||
if (object.Equals(storage, value)) return false; | |||
|
|||
storage = value; | |||
this.OnPropertyChanged(propertyName); | |||
return true; | |||
} | |||
|
|||
/// <summary> | |||
/// Notifies listeners that a property value has changed. | |||
/// </summary> | |||
/// <param name="propertyName">Name of the property used to notify listeners. This | |||
/// value is optional and can be provided automatically when invoked from compilers | |||
/// that support <see cref="CallerMemberNameAttribute"/>.</param> | |||
protected void OnPropertyChanged([CallerMemberName] string propertyName = null) | |||
{ | |||
var eventHandler = this.PropertyChanged; | |||
if (eventHandler != null) | |||
{ | |||
eventHandler(this, new PropertyChangedEventArgs(propertyName)); | |||
} | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
using System; | |||
using Windows.UI.Xaml.Data; | |||
|
|||
namespace Play.Common | |||
{ | |||
/// <summary> | |||
/// Value converter that translates true to false and vice versa. | |||
/// </summary> | |||
public sealed class BooleanNegationConverter : IValueConverter | |||
{ | |||
public object Convert(object value, Type targetType, object parameter, string language) | |||
{ | |||
return !(value is bool && (bool)value); | |||
} | |||
|
|||
public object ConvertBack(object value, Type targetType, object parameter, string language) | |||
{ | |||
return !(value is bool && (bool)value); | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Runtime.CompilerServices; | |||
using Windows.Foundation; | |||
using Windows.Foundation.Collections; | |||
using Windows.Graphics.Display; | |||
using Windows.UI.ViewManagement; | |||
using Windows.UI.Xaml; | |||
using Windows.UI.Xaml.Controls; | |||
using Windows.UI.Xaml.Data; | |||
|
|||
namespace Play.Common | |||
{ | |||
/// <summary> | |||
/// Value converter that translates true to <see cref="Visibility.Visible"/> and false to | |||
/// <see cref="Visibility.Collapsed"/>. | |||
/// </summary> | |||
public sealed class BooleanToVisibilityConverter : IValueConverter | |||
{ | |||
public object Convert(object value, Type targetType, object parameter, string language) | |||
{ | |||
return (value is bool && (bool)value) ? Visibility.Visible : Visibility.Collapsed; | |||
} | |||
|
|||
public object ConvertBack(object value, Type targetType, object parameter, string language) | |||
{ | |||
return value is Visibility && (Visibility)value == Visibility.Visible; | |||
} | |||
} | |||
} |
Oops, something went wrong.