/// <summary>
        /// Constructor
        /// </summary>
        public SelectSitePage()
        {
            // the logo to show
            var logo = new Image()
            {
                Source        = ImageSource.FromFile(GetLogo()),
                Aspect        = Aspect.AspectFit,
                WidthRequest  = 100,
                HeightRequest = 100
            };

            // the label. Change to whatever you want
            var label = new Label()
            {
                Text              = $"Enter your {Constants.DisplayShortName} domain",
                FontSize          = 20,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                TextColor         = Color.FromHex("#ffffff"),
                FontFamily        = GetFont()
            };

            // the input field
            var entry = new Entry()
            {
                TextColor       = Color.FromHex("#555555"),
                Placeholder     = "Weavy cloud domain or custom url",
                Text            = "",
                BackgroundColor = Color.White,
                Keyboard        = Keyboard.Url,
                FontFamily      = GetFont()
            };

            // the button
            _button = new Button()
            {
                Text            = "Continue",
                BackgroundColor = Color.FromHex("#1A85B7"),
                TextColor       = Color.White,
                FontSize        = 15,
                FontFamily      = GetFont()
            };

            // this is just a helper label displaying what the user has entered
            var urlLabel = new Label {
                Text              = ResolveUrl(entry.Text),
                FontSize          = 14,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                TextColor         = Color.FromHex("#ffffff"),
                FontFamily        = GetFont(),
                Margin            = GetLabelMargin()
            };

            // an activity indicator shown on submit
            _activity = new ActivityIndicator()
            {
                IsRunning = true,
                IsVisible = false
            };

            // the layout
            var layout = new StackLayout {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Spacing           = 14,
                BackgroundColor   = Color.FromHex("#1f9cd6"),
                Padding           = GetLayoutPadding(),
                Children          = { logo, label, entry, urlLabel, _button, _activity }
            };

            // handle url entry changes
            entry.TextChanged += (sender, args) => {
                urlLabel.Text = ResolveUrl(entry.Text);
            };

            // handle button click
            _button.Clicked += async(sender, args) => {
                var networkHelper = new NetworkHelper();
                var url           = ResolveUrl(entry.Text);

                ToggleActivity(true);

                if (networkHelper.Connected())
                {
                    url = EnsureHttps(url);

                    // check reachability of entered url
                    var reachable = await networkHelper.IsReachable(url);

                    if (reachable)
                    {
                        ToggleActivity(false);

                        //Store url in settings
                        CrossSettings.Current.Set <string>("url", $"{url}/messenger");

                        //Show page
                        Application.Current.MainPage = new MainPage();
                    }
                    else
                    {
                        ToggleActivity(false);
                        await DisplayAlert("Error", "Something went wrong. Please make sure you entered a correct url.", "OK");
                    }
                }
                else
                {
                    ToggleActivity(false);
                    await DisplayAlert("Connection error", "You need an internet connection to use this app.", "OK");
                }
            };

            // set the content
            Content = layout;
        }