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 AboutViewModel : BaseViewModel | |
{ | |
public AboutViewModel() | |
{ | |
Title = "About"; | |
OpenWebCommand = new Command(async () => await Browser.OpenAsync("https://aka.ms/xamarin-quickstart")); | |
} | |
public ICommand OpenWebCommand { get; } | |
} |
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
<Shell.Resources> | |
<ResourceDictionary> | |
<Style x:Key="BaseStyle" TargetType="Element"> | |
<Setter Property="Shell.BackgroundColor" Value="{StaticResource Primary}" /> | |
<Setter Property="Shell.ForegroundColor" Value="White" /> | |
<Setter Property="Shell.TitleColor" Value="White" /> | |
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" /> | |
<Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" /> | |
<Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource Primary}" /> | |
<Setter Property="Shell.TabBarForegroundColor" Value="White"/> |
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" ?> | |
<Application xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="App1.App"> | |
<!-- | |
Define global resources and styles here, that apply to all pages in your app. | |
--> | |
<Application.Resources> | |
<ResourceDictionary> | |
<Color x:Key="Primary">#2196F3</Color> |
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |
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
floatingActionButton: FloatingActionButton( | |
onPressed: _incrementCounter, | |
tooltip: 'Increment', | |
child: Icon(Icons.add), | |
), // This trailing comma makes auto-formatting nicer for build methods. |
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 async void OnSave() | |
{ | |
Item newItem = new Item() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Text = Text, | |
Description = Description | |
}; | |
await DataStore.AddItemAsync(newItem); |
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 NewItemViewModel() | |
{ | |
SaveCommand = new Command(OnSave, ValidateSave); | |
CancelCommand = new Command(OnCancel); | |
this.PropertyChanged += | |
(_, __) => SaveCommand.ChangeCanExecute(); | |
} |
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 Command SaveCommand { get; } | |
public Command CancelCommand { get; } |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Windows.Input; | |
using testxamarin.Models; | |
using Xamarin.Forms; | |
namespace testxamarin.ViewModels | |
{ | |
public class NewItemViewModel : BaseViewModel |
NewerOlder