Exemplo n.º 1
0
        public IdeaViewModel(INavigation navigation, Idea idea)
            : base(navigation)
        {
            Idea = idea;

            SaveCommand = new Command(async () =>
            {
                var service = await App.GetIdeaServiceAsync();
                await service.SaveIdeaAsync(Idea);
                await Navigation.PopAsync();
            });

            DeleteCommand = new Command(async () =>
            {
                var service = await App.GetIdeaServiceAsync();
                await service.DeleteIdeaAsync(Idea);
                await Navigation.PopAsync();
            });

            CancelCommand = new Command(() =>
            {
                Navigation.PopAsync();
            });
        }
Exemplo n.º 2
0
        public IdeaView(Idea idea)
        {
            InitializeComponent();

            BindingContext = new IdeaViewModel(Navigation, idea);
        }