Exemplo n.º 1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            App x = Application.Current as App;

            if (x.bviewModel == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(x.bviewModel.M_Current.Receipt_name))
            {
                return;
            }
            mbindingViewModels.Find(x.bviewModel.M_Current.Receipt_name);

            x.bviewModel = null;
        }
Exemplo n.º 2
0
        private void IBSearch_Clicked(object sender, EventArgs e)
        {
            M_dictionary.Clear();
            m_grid.Children.Clear();
            int num_count;

            if (input.Text != null)
            {
                mbindingViewModels.Find(input.Text);
                num_count = 1;
                Label label = new Label
                {
                    Text                    = mbindingViewModels.M_Current.Receipt_name,
                    TextColor               = Color.Black,
                    BackgroundColor         = Color.White,
                    HorizontalOptions       = LayoutOptions.FillAndExpand,
                    VerticalTextAlignment   = TextAlignment.Center,
                    HorizontalTextAlignment = TextAlignment.Center
                };
                m_grid.Children.Add(label, 0, 0);
                //欄 行
                Button button = new Button
                {
                    Text              = "選擇",
                    TextColor         = Color.Black,
                    BackgroundColor   = Color.White,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };
                button.Clicked += Button_temp_Clicked;
                m_grid.Children.Add(button, 1, 0);
                M_dictionary.Add(button, label);
            }
            else
            {
                num_count = mbindingViewModels.M_All.Count();


                for (int i = 0; i < num_count; i++)
                {
                    Label label = new Label
                    {
                        Text                    = mbindingViewModels.M_All[i].Receipt_name,
                        TextColor               = Color.Black,
                        BackgroundColor         = Color.White,
                        HorizontalOptions       = LayoutOptions.FillAndExpand,
                        VerticalTextAlignment   = TextAlignment.Center,
                        HorizontalTextAlignment = TextAlignment.Center
                    };
                    m_grid.Children.Add(label, 0, i);
                    //欄 行
                    Button button = new Button
                    {
                        Text              = "選擇",
                        TextColor         = Color.Black,
                        BackgroundColor   = Color.White,
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                    };
                    button.Clicked += Button_temp_Clicked;
                    M_dictionary.Add(button, label);
                    m_grid.Children.Add(button, 1, i);
                }
            }
        }