forked from Windows-XAML/Template10
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jerrynixon
committed
Jan 29, 2016
1 parent
81f315d
commit 51e5a0e
Showing
32 changed files
with
184 additions
and
204 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
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
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Template10.Mvvm; | ||
using Template10.Services.NavigationService; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace Sample.ViewModels | ||
{ | ||
public class MainPageViewModel : ViewModelBase | ||
{ | ||
public MainPageViewModel() | ||
{ | ||
if (Windows.ApplicationModel.DesignMode.DesignModeEnabled) | ||
{ | ||
// design-time experience | ||
} | ||
else | ||
{ | ||
// runtime experience | ||
} | ||
} | ||
|
||
public override Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state) | ||
{ | ||
if (state.Any()) | ||
{ | ||
// restore state | ||
state.Clear(); | ||
} | ||
else | ||
{ | ||
// use parameter | ||
} | ||
return Task.CompletedTask; | ||
} | ||
|
||
public override Task OnNavigatedFromAsync(IDictionary<string, object> state, bool suspending) | ||
{ | ||
if (suspending) | ||
{ | ||
// save state | ||
} | ||
return Task.CompletedTask; | ||
} | ||
|
||
public override Task OnNavigatingFromAsync(NavigatingEventArgs args) | ||
{ | ||
args.Cancel = false; | ||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
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
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
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
This file was deleted.
Oops, something went wrong.
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
32 changes: 0 additions & 32 deletions
32
Templates (Project)/Hamburger/Services/SettingsServices/SettingsService.Apply.cs
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace Sample.Views | ||
{ | ||
public sealed partial class Busy : UserControl, INotifyPropertyChanged | ||
public sealed partial class Busy : UserControl | ||
{ | ||
public Busy() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
string _BusyText = default(string); | ||
public string BusyText { get { return _BusyText; } set { Set(ref _BusyText, value); } } | ||
|
||
bool _IsBusy = default(bool); | ||
public bool IsBusy { get { return _IsBusy; } set { Set(ref _IsBusy, value); } } | ||
|
||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
void Set<T>(ref T storage, T value, [CallerMemberName] string propertyName = null) | ||
public string BusyText | ||
{ | ||
if (!Equals(storage, value)) | ||
{ | ||
storage = value; | ||
RaisePropertyChanged(propertyName); | ||
} | ||
get { return (string)GetValue(BusyTextProperty); } | ||
set { SetValue(BusyTextProperty, value); } | ||
} | ||
public static readonly DependencyProperty BusyTextProperty = | ||
DependencyProperty.Register("BusyText", typeof(string), typeof(Busy), new PropertyMetadata("Please wait...")); | ||
|
||
void RaisePropertyChanged([CallerMemberName] string propertyName = null) => | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
public bool IsBusy | ||
{ | ||
get { return (bool)GetValue(IsBusyProperty); } | ||
set { SetValue(IsBusyProperty, value); } | ||
} | ||
public static readonly DependencyProperty IsBusyProperty = | ||
DependencyProperty.Register("IsBusy", typeof(bool), typeof(Busy), new PropertyMetadata(false)); | ||
} | ||
} |
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
Oops, something went wrong.