示例#1
0
        public HomePage()
        {
            var goButton = new Button()
            {
                Text = "Go",
            };
            var user = new Entry()
            {
                Placeholder       = "enter name",
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };

            Title   = "Home";
            Content = new StackLayout
            {
                Padding         = 20,
                Orientation     = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.Center,
                Children        =
                {
                    user,
                    goButton
                }
            };

            goButton.Clicked += async(sender, args) =>
            {
                var chatPage = new ChatPage {
                    ChatUser = user.Text
                };

                await Navigation.PushAsync(chatPage);
            };
        }
        public HomePage()
        {
            var goButton = new Button()
            {
                Text = "Go",
            };
            var user = new Entry()
            {

                Placeholder = "enter name",
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };

            Title = "Home";
            Content = new StackLayout
            {
                Padding = 20,
                Orientation = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.Center,
                Children =
                {
                    user,
                    goButton
                }
            };

            goButton.Clicked += async (sender, args) =>
            {
                var chatPage = new ChatPage {ChatUser = user.Text};

                await Navigation.PushAsync(chatPage);

            };

        }