public App()
        {
            InitializeComponent();

            lsClient = new RTfeed();

            MainPage = Appa.GetMainPage(lsClient);
        }
Example #2
0
        public static Page GetMainPage(RTfeed f)
        {
            var tdlx = new MainPage(f);

            var mainNav = new NavigationPage(tdlx);

            mainNav.Icon = "icon.png";

            return(mainNav);
        }
        public DetailsPage(RTfeed _myClass, int pos)
        {
            InitializeComponent();

            __myClass = _myClass;

            Disappearing += EventPage_OnDisappearing;

            __myClass.SubscribeDetails(pos);

            BindingContext = _myClass;

            txtDtls = new TextCell[8];

            txtDtls[0] = new TextCell {
                Text = "0.0", Detail = "Name", TextColor = Color.OliveDrab
            };
            txtDtls[1] = new TextCell {
                Text = "0.0", Detail = "Last Price", TextColor = Color.DodgerBlue
            };
            txtDtls[2] = new TextCell {
                Text = "0.0", Detail = "Last Time", TextColor = Color.OliveDrab
            };
            txtDtls[3] = new TextCell {
                Text = "0.0", Detail = "Max", TextColor = Color.DodgerBlue
            };
            txtDtls[4] = new TextCell {
                Text = "0.0", Detail = "Min", TextColor = Color.OliveDrab
            };
            txtDtls[7] = new TextCell {
                Text = "0.0", Detail = "Best Bid", TextColor = Color.DodgerBlue
            };
            txtDtls[6] = new TextCell {
                Text = "0.0", Detail = "Best Ask", TextColor = Color.OliveDrab
            };
            txtDtls[5] = new TextCell {
                Text = "0.0", Detail = "Change %", TextColor = Color.DodgerBlue
            };

            myTable = new TableView
            {
                Intent = TableIntent.Data,
                Root   = new TableRoot("Lightstreamer Xamarin Stock-List Demo")
                {
                    new TableSection("Stock Details")
                    {
                        txtDtls[0],
                        txtDtls[1],
                        txtDtls[2],
                        txtDtls[3],
                        txtDtls[4],
                        txtDtls[7],
                        txtDtls[6],
                        txtDtls[5]
                    }
                }
            };
            myTable.BackgroundColor = Color.Honeydew;


            txtDtls[0].SetBinding(TextCell.TextProperty, "DetailsName", BindingMode.OneWay);

            txtDtls[1].SetBinding(TextCell.TextProperty, "DetailsLast", BindingMode.OneWay);

            txtDtls[2].SetBinding(TextCell.TextProperty, "DetailsTime", BindingMode.OneWay);

            txtDtls[4].SetBinding(TextCell.TextProperty, "DetailsMin", BindingMode.OneWay);

            txtDtls[3].SetBinding(TextCell.TextProperty, "DetailsMax", BindingMode.OneWay);

            txtDtls[5].SetBinding(TextCell.TextProperty, "DetailsChg", BindingMode.OneWay);

            txtDtls[5].SetBinding(TextCell.TextColorProperty, "DetailsChgDiff", BindingMode.OneWay);

            txtDtls[6].SetBinding(TextCell.TextProperty, "DetailsAsk", BindingMode.OneWay);

            txtDtls[7].SetBinding(TextCell.TextProperty, "DetailsBid", BindingMode.OneWay);

            Thickness padd  = new Thickness(0);
            double    scale = 1.0;

            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                padd = new Thickness(0, 20, 0, 0);
                break;

            case Device.Android:
                padd = new Thickness(15, 10);
                break;

            case Device.UWP:
                padd           = new Thickness(75, 50);
                myTable.Margin = new Thickness(25, 25);
                scale          = 1.2;
                break;
            }
            detailsLayout = new StackLayout {
                Padding = padd, Scale = scale
            };
            detailsLayout.Children.Add(myTable);
            this.Content = detailsLayout;
        }
Example #4
0
 public QuoteListener(RTfeed rTfeed)
 {
     this.rTfeed = rTfeed;
 }
Example #5
0
        public MainPage(RTfeed f)
        {
            InitializeComponent();

            _myClass = f;

            ToolbarItems.Add(new ToolbarItem("About", "menu.png", () => {
                Navigation.PushAsync(new AboutPage());
                Debug.WriteLine("About Page.");
            }));

            BindingContext = _myClass;

            txtStatusLbl = new TextCell {
                Text = "Lightstreamer is connecting ... ", TextColor = Color.Orange
            };
            txtStock = new TextCell[6];

            txtStock[0] = new TextCell {
                Text = "0.0", Detail = "...", TextColor = Color.OliveDrab, Command = new Command(() => Navigation.PushAsync(new DetailsPage(_myClass, 2)))
            };
            txtStock[1] = new TextCell {
                Text = "0.0", Detail = "...", TextColor = Color.DodgerBlue, Command = new Command(() => Navigation.PushAsync(new DetailsPage(_myClass, 7)))
            };
            txtStock[2] = new TextCell {
                Text = "0.0", Detail = "...", TextColor = Color.OliveDrab, Command = new Command(() => Navigation.PushAsync(new DetailsPage(_myClass, 11)))
            };
            txtStock[3] = new TextCell {
                Text = "0.0", Detail = "...", TextColor = Color.DodgerBlue, Command = new Command(() => Navigation.PushAsync(new DetailsPage(_myClass, 18)))
            };
            txtStock[4] = new TextCell {
                Text = "0.0", Detail = "...", TextColor = Color.OliveDrab, Command = new Command(() => Navigation.PushAsync(new DetailsPage(_myClass, 22)))
            };
            txtStock[5] = new TextCell {
                Text = "0.0", Detail = "...", TextColor = Color.DodgerBlue, Command = new Command(() => Navigation.PushAsync(new DetailsPage(_myClass, 27)))
            };
            myTable = new TableView
            {
                Intent = TableIntent.Data,
                Root   = new TableRoot("Lightstreamer Xamarin Stock-List Demo")
                {
                    new TableSection("Stocks")
                    {
                        txtStock[0],
                        txtStock[1],
                        txtStock[2],
                        txtStock[3],
                        txtStock[4],
                        txtStock[5],
                        txtStatusLbl,
                    }
                }
            };
            myTable.BackgroundColor = Color.LightGoldenrodYellow;

            Thickness padd  = new Thickness(0);
            double    scale = 1.0;

            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                padd = new Thickness(0, 20, 0, 0);
                break;

            case Device.Android:
                padd = new Thickness(15, 10);
                break;

            case Device.UWP:
                padd           = new Thickness(75, 50);
                myTable.Margin = new Thickness(25, 25);
                scale          = 1.2;
                break;
            }

            txtStock[0].SetBinding(TextCell.TextProperty, "LabelText0", BindingMode.TwoWay);
            txtStock[0].SetBinding(TextCell.DetailProperty, "DescText0", BindingMode.TwoWay);

            txtStock[1].SetBinding(TextCell.TextProperty, "LabelText1", BindingMode.TwoWay);
            txtStock[1].SetBinding(TextCell.DetailProperty, "DescText1", BindingMode.TwoWay);

            txtStock[2].SetBinding(TextCell.TextProperty, "LabelText2", BindingMode.TwoWay);
            txtStock[2].SetBinding(TextCell.DetailProperty, "DescText2", BindingMode.TwoWay);

            txtStock[3].SetBinding(TextCell.TextProperty, "LabelText3", BindingMode.TwoWay);
            txtStock[3].SetBinding(TextCell.DetailProperty, "DescText3", BindingMode.TwoWay);

            txtStock[4].SetBinding(TextCell.TextProperty, "LabelText4", BindingMode.TwoWay);
            txtStock[4].SetBinding(TextCell.DetailProperty, "DescText4", BindingMode.TwoWay);

            txtStock[5].SetBinding(TextCell.TextProperty, "LabelText5", BindingMode.TwoWay);
            txtStock[5].SetBinding(TextCell.DetailProperty, "DescText5", BindingMode.TwoWay);

            txtStatusLbl.SetBinding(TextCell.TextProperty, "StatusText", BindingMode.TwoWay);
            txtStatusLbl.SetBinding(TextCell.TextColorProperty, "StatusColor", BindingMode.TwoWay);

            layout = new StackLayout {
                Padding = padd, Scale = scale
            };

            layout.Children.Add(myTable);

            this.Content = layout;
        }
Example #6
0
 public DetailsListener(RTfeed rTfeed)
 {
     this.rTfeed = rTfeed;
 }
 public TestConnectionListener(RTfeed rTfeed)
 {
     this.rTfeed = rTfeed;
 }