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


C# Canvas.Show方法代码示例

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


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

示例1: AvalonExampleGalleryCanvas


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

			AllPages.ForEach(
				(k, i) =>
				{
					var o = new OptionWithShadowAndType(k.Key, k.Value);


					var ce = new SimpleCarouselControl.EntryInfo
					{
						Source = (k.Key + "/Preview.png").ToSource(),
						Position = i * Math.PI * 2 / AllPages.Count,
						MouseEnter =
							delegate
							{
								cc.Caption.Text = o.Caption.Text;
							},
						MouseLeave =
							delegate
							{
								cc.Caption.Text = cc_Caption;
							},
						Click =
							delegate
							{
								o.InitializeHint();


								navbar.History.Add(
									delegate
									{
										
										cc.Timer.Start();
										o.Target.Orphanize();
										CarouselPages.Show();
										Overlay.Show();
										btnCarouselCanvas.Show();
									},
									delegate
									{
										if (AtViewSelected != null)
											AtViewSelected(o.Caption.Text);


										btnCarouselCanvas.Hide();
										cc.Timer.Stop();
										CarouselPages.Hide();
										Overlay.Hide();
										o.Target.AttachTo(Container);
									}
								);
							}
					};

					cc.AddEntry(ce);


					OptionPosition p = null;

					if (GetOptionPosition != null)
						p = GetOptionPosition(o.Caption.Text);

					if (p == null)
					{
						o.MoveTo(
							48 + (180) * (i % 4),
							36 + Convert.ToInt32(i / 4) * 128
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:67,代码来源:AvalonExampleGalleryCanvas.cs

示例2: AvalonPipeManiaCanvas


//.........这里部分代码省略.........
                    }
                },
                { typeof(SpaceInvaderTest),
                    () => new SpaceInvaderTest
                    {
                        Visibility = Visibility.Hidden
                    }
                },
                { typeof(AnimationsTest),
                    () => new AnimationsTest
                    {
                        Visibility = Visibility.Hidden
                    }
                },
            };

            var Content = new Canvas
            {
                Width = DefaultWidth,
                Height = DefaultHeight
            }.AttachTo(this);

            var Buttons = new Canvas
            {
                Width = DefaultWidth,
                Height = DefaultHeight
            }.AttachTo(this);

            var Navigationbar = new AeroNavigationBar();

            Navigationbar.Container.MoveTo(4, 4).AttachTo(this);

            #region generate the menu
            const int ButtonHeight = 30;

            // x:\jsc.svn\examples\actionscript\Test\TestDictionaryOfTypeAndFunc\TestDictionaryOfTypeAndFunc\ApplicationCanvas.cs
            Options
                //.ForEach(
                .Select(Option => new { Option.Key, Option.Value })
                .WithEachIndex(
                (Option, Index) =>
                {
                    var x = 72;
                    var y = 16 + Index * ButtonHeight;

                    var Button = new TextButtonControl
                    {
                        Text = (Index + 1) + ". Open " + Option.Key.Name,
                        Width = 200,
                        Height = ButtonHeight
                    };

                    Button.Background.Fill = Brushes.Black;
                    Button.Background.Opacity = 0.5;
                    Button.Foreground = Brushes.Blue;

                    Button.MouseEnter +=
                        delegate
                        {

                            Button.Background.Fill = Brushes.Blue;
                            Button.Background.Opacity = 0.5;
                            Button.Foreground = Brushes.White;
                        };

                    Button.MouseLeave +=
                        delegate
                        {
                            Button.Background.Fill = Brushes.Black;
                            Button.Background.Opacity = 0.5;
                            Button.Foreground = Brushes.Blue;
                        };

                    var OptionCanvas = default(Canvas);

                    Button.Click +=
                        delegate
                        {
                            if (OptionCanvas == null)
                                OptionCanvas = Option.Value();

                            Navigationbar.History.Add(
                                delegate
                                {
                                    OptionCanvas.Orphanize().Hide();
                                    Buttons.Show();
                                },
                                delegate
                                {
                                    OptionCanvas.AttachTo(Content).Show();
                                    Buttons.Hide();
                                }
                            );
                        };

                    Button.Container.MoveTo(x, y).AttachTo(Buttons);
                }
            );
            #endregion
        }
开发者ID:skdhayal,项目名称:avalonpipemania,代码行数:101,代码来源:AvalonPipeManiaCanvas.cs


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