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
public class HatPepper | |
{ | |
public IList<Shop> SearchShops() | |
{ | |
IGeolocationService geolocationService = new GeolocationService(); | |
var location = geolocationService.GetCurrentLocation(); | |
// 以降、取得した位置情報から周辺の店舗を取得して返却する | |
} | |
} |
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
public class HatPepper | |
{ | |
public IList<Shop> SearchShops() | |
{ | |
GeolocationService geolocationService = new GeolocationService(); | |
var location = geolocationService.GetCurrentLocation(); | |
// 以降、取得した位置情報から周辺の店舗を取得して返却する | |
} | |
} |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" | |
prism:ViewModelLocator.AutowireViewModel="True" | |
x:Class="HelloPrism.Views.MainPage" | |
Title="MainPage"> | |
<StackLayout HorizontalOptions="Center" VerticalOptions="Center"> | |
<Label Text="{Binding Title}" /> | |
</StackLayout> |
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
public class App : Application | |
{ | |
public App() | |
{ | |
MainPage = new ContentPage | |
{ | |
Content = new StackLayout | |
{ | |
VerticalOptions = LayoutOptions.Center, | |
Children = { |
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
public partial class App : PrismApplication | |
{ | |
public App(IPlatformInitializer initializer = null) : base(initializer) { } | |
protected override void OnInitialized() | |
{ | |
InitializeComponent(); | |
NavigationService.NavigateAsync("MainPage?title=Hello%20from%20Xamarin.Forms"); | |
} | |
protected override void RegisterTypes() | |
{ |
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
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate | |
{ | |
public override bool FinishedLaunching(UIApplication app, NSDictionary options) | |
{ | |
global::Xamarin.Forms.Forms.Init(); | |
LoadApplication(new App()); | |
return base.FinishedLaunching(app, options); | |
} | |
} |
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
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate | |
{ | |
public override bool FinishedLaunching(UIApplication app, NSDictionary options) | |
{ | |
global::Xamarin.Forms.Forms.Init(); | |
LoadApplication(new App(new iOSInitializer())); | |
return base.FinishedLaunching(app, options); | |
} | |
} |
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
private string _name; | |
public string Name | |
{ | |
get { return _name; } | |
set | |
{ | |
if (OnPropertyChanged(ref _name, value)) | |
ExecuteCommand.RaiseCanExecuteChanged(); | |
} | |
} |
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
public DelegateCommand ExecuteCommand { get; } | |
public MainWindowViewModel() | |
{ | |
ExecuteCommand = | |
new DelegateCommand( | |
() => Result = "登録されました", | |
CanExecute); | |
} |
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
<Window x:Class="CommandSample.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="clr-namespace:CommandSample" | |
Title="MainWindow" Height="350" Width="525"> | |
<Window.DataContext> | |
<local:MainWindowViewModel/> | |
</Window.DataContext> | |
<StackPanel Orientation="Vertical"> | |
<Label Content="氏名"/> |