当前位置: 首页>>代码示例>>C#>>正文


C# DropDownList.Toggle方法代码示例

本文整理汇总了C#中DropDownList.Toggle方法的典型用法代码示例。如果您正苦于以下问题:C# DropDownList.Toggle方法的具体用法?C# DropDownList.Toggle怎么用?C# DropDownList.Toggle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DropDownList的用法示例。


在下文中一共展示了DropDownList.Toggle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            ddl = GetDDL1 ();
            ddl.DropDownTopInset = 60;
            ddl.DropDownListChanged += (e, a) => {
                var index = e; // e is the index selected
                var strValue = a.DisplayText; //a is the dropdown list item object
                var id = a.Id;
                lblSelection.Text = string.Format ("Id: {0} => Text: {1}", id, strValue);
                ddl.Toggle ();
            };

            NavigationItem.SetRightBarButtonItem (
                new UIBarButtonItem (UIImage.FromFile ("top_charts.png"), UIBarButtonItemStyle.Plain,
                    (sender, e) => {
                        ddl.Toggle ();
                    }), false);
        }
开发者ID:rickyp29,项目名称:Xamarin_iOS_Finance_App,代码行数:19,代码来源:Valore.DropDownDemoViewController.cs

示例2: ViewDidLoad


//.........这里部分代码省略.........

            glButton2.ValueChanged += (sender, e) => {var selectedSegmentId = (sender as UISegmentedControl).SelectedSegment;
                if(glButton2.SelectedSegment == 0)
                {
                    glButton2.SelectedSegment = -1;
                }
            };

            realizedLabel = new UILabel ();
            realizedLabel.Text = "$11MM";
            realizedLabel.Font = UIFont.FromName ("Helveticaneue-Bold", 16);
            realizedLabel.TextColor = UIColor.Green;
            realizedLabel.Frame = new CGRect (210, 130, 100, 50);

            realizedP = new UILabel ();
            realizedP.Text = "   2%";
            realizedP.Font = UIFont.FromName ("Helveticaneue-Bold", 16);
            realizedP.TextColor = UIColor.Green;
            realizedP.Frame = new CGRect (210, 150, 100, 50);

            dateButtons = new UISegmentedControl ();
            dateButtons.Frame = new CGRect (25, View.Frame.Height - 65, 280, 25);
            dateButtons.InsertSegment ("1D", 0, true);
            dateButtons.InsertSegment ("1W", 1, true);
            dateButtons.InsertSegment ("1M", 2, true);
            dateButtons.InsertSegment ("6M", 3, true);
            dateButtons.InsertSegment ("ITD",4, true);
            //dateButtons.SelectedSegment = 0;

            dateButtons.ValueChanged += (sender, e) => {var selectedSegmentId = (sender as UISegmentedControl).SelectedSegment;
                if(dateButtons.SelectedSegment == 0)
                {
                    //View.ReloadInputViews();
                    //this.LoadDoughnutChart("1 Day");
                }
            };

            fadeOutView               	= new UIView(this.View.Bounds);
            fadeOutView.BackgroundColor	= UIColor.FromRGBA( 0.537f ,0.537f,0.537f,0.3f);

            ddl = GetDDL1 ();
            ddl.DropDownTopInset = 60;

            ddl.DropDownListChanged += (e, a) => {
                var index = e; // e is the index selected
                var strValue = a.DisplayText; //a is the dropdown list item object
                var id = a.Id;
                if(index == 0)
                {
                    NavigationItem.Title = "A";
                    realizedP.Text = "    2%";
                    realizedP.TextColor = UIColor.Green;

                    realizedLabel.Text = "$11MM";
                    realizedLabel.TextColor = UIColor.Green;

                    unrealizedLabel.Text = "$2MM";
                    unrealizedLabel.TextColor = UIColor.Green;

                    unrealizedP.Text = "  6%";
                    unrealizedP.TextColor = UIColor.Green;
                }

                if(index == 1)
                {
                    NavigationItem.Title = "B";

                    unrealizedP.Text = "   9%";
                    unrealizedP.TextColor = UIColor.Red;

                    unrealizedLabel.TextColor = UIColor.Red;
                    unrealizedLabel.Text = "$8MM";

                    realizedP.Text = "    5%";
                    realizedP.TextColor = UIColor.Red;

                    realizedLabel.Text = "$15MM";
                    realizedLabel.TextColor = UIColor.Red;
                }

                ddl.Toggle ();
            };

            NavigationItem.SetRightBarButtonItem (
                new UIBarButtonItem (UIImage.FromFile ("top_charts.png"), UIBarButtonItemStyle.Plain,
                    (sender, e) => {
                        ddl.Toggle ();
                    }), false);

            this.LoadDoughnutChart (chartTitle);
            this.View.BackgroundColor = UIColor.White;
            this.View.Add (plButtons);
            this.View.Add (dateButtons);
            this.View.Add (glButton);
            this.View.Add (unrealizedLabel);
            this.View.Add (unrealizedP);
            this.View.Add (realizedLabel);
            this.View.Add (realizedP);
            this.View.Add (glButton2);
        }
开发者ID:rickyp29,项目名称:Xamarin_iOS_Finance_App,代码行数:101,代码来源:SelectClientPage.cs


注:本文中的DropDownList.Toggle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。