Esempio n. 1
0
        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);
            }
        }
Esempio n. 3
0
        public NewDetailPage(NewDetailViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = this.viewModel = viewModel;
        }