예제 #1
0
        public DialogueLayout(DialogueResponse DResponse, ContentPageController ViewController)
        {
            var labelLarge = new Label
            {
                Text = "Message From Server",
                FontSize = 25,
                HorizontalOptions = LayoutOptions.Center,
                HeightRequest = 55
            };

            var DialogueLabel = new Label
            {
                Text = DResponse.Dialogue,
                FontSize = 30,
                HorizontalOptions = LayoutOptions.Center,
                HeightRequest = 110
            };

            dialoguebutton = new Button
            {
                Text = "Ok",
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof (Button)),
                VerticalOptions = LayoutOptions.Fill,
                //TranslationY = 2,
                HeightRequest = 55
                //IsVisible = false,
            };
            // The View
            DiaLayout = new StackLayout
            {
                Children =
                {
                    labelLarge,
                    DialogueLabel,
                    dialoguebutton
                },
                Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
            };


            dialoguebutton.Clicked += (sender, args) =>
            {
                ViewController.Invoke(() => dialoguebutton.IsEnabled = false);
                // return to previous sceen
                Display(ViewController, StoredContent);
                ViewController.Invoke(() => dialoguebutton.IsEnabled = false);
            };

            StoredContent = ViewController.View.Content;
            Display(ViewController);
        }
예제 #2
0
 internal static void DisplayDialogue(DialogueResponse DiaResponse)
 {
     var DLayout = new DialogueLayout(DiaResponse, ViewController);
 }