public NewDetailPage() { InitializeComponent(); var item = new New { Title = "Item 1", Description = "This is an item description." }; viewModel = new NewDetailViewModel(item); BindingContext = viewModel; }
public NewDetailPage(NewDetailViewModel viewModel) { InitializeComponent(); BindingContext = this.viewModel = viewModel; if (Auth.User.Id == viewModel.Item.AuthorId || Auth.User.Role == "1") { Button btn_rmv = new Button { Text = "Отправить в архив", BackgroundColor = Color.SpringGreen, TextColor = Color.White, FontSize = 22 }; btn_rmv.Clicked += RemoveEvent; sL.Children.Add(btn_rmv); } }
public NewDetailPage(NewDetailViewModel viewModel) { InitializeComponent(); BindingContext = this.viewModel = viewModel; }