Example #1
0
        /// <summary>
        /// 处理ListMenuView的元素点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listMenuView1_ItemPress(object sender, ListMenuViewItemPressEventArgs e)
        {
            switch (e.Item.Tag.ToString())
            {
            case "demoListViewRefresh":
                //显示demoListViewRefresh窗体
                this.Show(new demoListViewRefresh());
                break;

            case "userFilter":
                //Dialog显示的自定义控件,如果重复使用,不需要每一次都实例化,如果需要实例化,记得把原来的给Destroy
                if (filter == null)
                {
                    //由于内部使用了Flex布局,需要在外部给定高度
                    filter           = new userFilter();
                    filter.Height    = 400;
                    filter.BackColor = System.Drawing.Color.White;

                    /* DialogOptions参数说明
                     * justifyAlign: LayoutJustifyAlign.FlexEnd 布局显示在最下面
                     * backColor: System.Drawing.Color.FromArgb(128, 128, 128, 128) 整个Dialog的背景色
                     * padding: Padding.Empty 设置内边框为空,就是全屏显示
                     * touchClosed: true 是否点击空白处关闭
                     */
                    filterOptions = new DialogOptions(justifyAlign: LayoutJustifyAlign.FlexEnd, backColor: System.Drawing.Color.FromArgb(128, 128, 128, 128), padding: Padding.Empty, touchClosed: true);
                }
                //弹出filter
                this.ShowDialog(filter, filterOptions);
                break;

            case "userFooterDialog":
                //Dialog显示的自定义控件,如果重复使用,不需要每一次都实例化,如果需要实例化,记得把原来的给Destroy
                if (footerDialog == null)
                {
                    //由于内部控件都有了高度,所以userFooterDialog不用设置高度,会自动撑大
                    footerDialog = new Smobiler.Tutorials.Samples.ShowDialog.userFooterDialog();

                    //同case "userFilter":中的参数设定
                    footerDialogOptions = new DialogOptions(LayoutJustifyAlign.FlexEnd, System.Drawing.Color.FromArgb(128, 128, 128, 128), Padding.Empty, true);
                }
                //弹出footerDialog
                this.ShowDialog(footerDialog, footerDialogOptions);
                break;

            case "userDialogPassword":
                if (footerDialogOptions == null)
                {
                    //同case "userFilter":中的参数设定
                    footerDialogOptions = new DialogOptions(LayoutJustifyAlign.FlexEnd, System.Drawing.Color.FromArgb(128, 128, 128, 128), Padding.Empty, true);
                }
                //创建userDialogPassword用户控件实例
                ShowDialog.userDialogPassword dialogPassowrd = new ShowDialog.userDialogPassword();
                //绑定DialogPassword事件
                dialogPassowrd.DialogPassword += (pass) => { MessageBox.Show(pass); };
                //弹出dialogPassowrd
                this.ShowDialog(dialogPassowrd, footerDialogOptions);
                break;

            case "demogetdata":
                //创建demogetdata用户控件实例
                demogetdata dm = new demogetdata();
                //绑定demogetdata的Selected事件
                dm.Selected += (obj, args) => { Toast(args.Text); };
                //弹出Dialog
                this.ShowDialog(dm);
                break;

            case "demoWebView":
                //显示demoWebView窗体
                this.Show(new demoWebView());
                break;

            case "demoCustomResource":
                //显示demoCustomResource窗体
                this.Show(new demoCustomResource());
                break;

            case "demoLoginRelativeLayout":
                //显示demoLoginRelativeLayout窗体
                this.Show(new demoLoginRelativeLayout());
                break;

            case "demoLoginAbsoluteLayout":
                //显示demoLoginAbsoluteLayout窗体
                this.Show(new demoLoginAbsoluteLayout());

                break;

            case "demoTransparent":
                //显示demoLoginAbsoluteLayout窗体
                this.Show(new demoTransparent());
                break;

            case "demoTwoWayScrolling":
                //显示demoTwoWayScrolling窗体
                this.Show(new demoTwoWayScrolling());
                break;

            case "demoTabToolbar":
                //显示demoTabToolbar窗体
                this.Show(new demoTabToolbar());
                break;

            case "demoHtmlInteraction":
                //显示demoTabToolbar窗体
                this.Show(new demoHtmlInteraction());
                break;

            case "demoListViewUpdate":
                this.Show(new demoListViewTemplateUpdate());
                break;

            case "demoListViewRemove":
                this.Show(new demoListViewRemove());
                break;

            case "demoListViewRowBind":
                this.Show(new demoListViewRowBind());
                break;
            }
        }
Example #2
0
        private void panel1_Press(object sender, EventArgs e)
        {
            demogetdata dmd = (demogetdata)this.Owner.Owner;

            dmd.OnSelected(this.label1.Text);
        }