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


C# Image.TranslateTo方法代码示例

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


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

示例1: MainPageArticoloViewCell

        public MainPageArticoloViewCell()
        {
            var label = new Label ();
            label.FontSize = 22;
            label.VerticalOptions = LayoutOptions.Center;
            label.HorizontalOptions = LayoutOptions.FillAndExpand;
            label.SetBinding (Label.TextProperty, Articolo.FIELD_NAME_art_DESC);

            immagineArticolo = new Image ();
            immagineArticolo.HorizontalOptions = LayoutOptions.End;
            // immagineArticolo.SetBinding (Image.SourceProperty, Articolo.FIELD_NAME_ImageFullFileName);
            immagineArticolo.SetBinding (Image.SourceProperty, Articolo.FIELD_NAME_UrlImg);
            immagineArticolo.HeightRequest = immagineArticolo.WidthRequest = 40;

            StackLayout contenitore = new StackLayout (){
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Orientation = StackOrientation.Horizontal,
                Padding = new Thickness(10),
                Children = {label, immagineArticolo}
            };

            this.View = contenitore;

            var moreAction = new MenuItem { Text = "Sposta Img", Icon = "arrow.png" };
            moreAction.SetBinding (MenuItem.CommandParameterProperty, new Binding ("."));
            moreAction.Clicked += async (sender, e) => {
                var mi = ((MenuItem)sender);
                Debug.WriteLine("More Context Action clicked: " + mi.CommandParameter);

                await immagineArticolo.TranslateTo (-100, 0, 2000, Easing.CubicIn);
                // immagineArticolo.TranslationX = -100;
            };
            var deleteAction = new MenuItem { Text = "Delete", IsDestructive = true }; // red background
            deleteAction.IsDestructive = true;
            deleteAction.SetBinding (MenuItem.CommandParameterProperty, new Binding ("."));
            deleteAction.Clicked += async (sender, e) => {
                var mi = ((MenuItem)sender);
                Debug.WriteLine("Delete Context Action clicked: " + mi.CommandParameter);
            };
            // add to the ViewCell's ContextActions property
            ContextActions.Add (moreAction);
            ContextActions.Add (deleteAction);
        }
开发者ID:maurocavallin,项目名称:CorsoXamarinGiugno2015,代码行数:43,代码来源:MainPageArticoloViewCell.cs

示例2: myLoad


//.........这里部分代码省略.........
						catID = 0;
					else
						catID = -1;
				}
				bindMap (catID, this.drCurrent);
				Debug.WriteLine ("Catid: " + catID);
			};




			leftPanel = new StackLayout () {
				//BackgroundColor = Color.Red,
				HeightRequest = App.k_screenHMinusNavigationBarBottomBar,
				WidthRequest = Device.OnPlatform (App.k_screenW /*- ((App.k_screenW / 100) * 11)*/, App.k_screenW, App.k_screenW),
				Children = { map }
			};



			img = new Image () {
				Source = ImageSource.FromResource ("testRestCompressed.Resources.barraMappa.png"),
				//WidthRequest = 20,
				//HeightRequest = 20
				//BackgroundColor = Color.Yellow,
			};

			var mytap = new TapGestureRecognizer ();
			img.GestureRecognizers.Add (mytap);

			mytap.Tapped += async delegate {
				if (!iscollapsed) {
					if (Device.OS == TargetPlatform.Android) {
						await rightPanel.TranslateTo (this.rightPanelWDip, 0, 250, Easing.Linear);
						iscollapsed = true;
					}
					if (Device.OS == TargetPlatform.iOS) {
						rightPanel.TranslateTo (this.rightPanelWDip, 0, 250, Easing.Linear);
						img.TranslateTo (this.rightPanelWDip, 0, 250, Easing.Linear);
						iscollapsed = true;
					}
				} else {
					if (Device.OS == TargetPlatform.Android) {
						await rightPanel.TranslateTo (0, 0, 250, Easing.Linear);
						iscollapsed = false;
					}
					if (Device.OS == TargetPlatform.iOS) {
						rightPanel.TranslateTo (0, 0, 250, Easing.Linear);
						img.TranslateTo (0, 0, 250, Easing.Linear);
						iscollapsed = false;

					}
						
				}
			};


			/*
			ListView l = new ListView ();
			l.ItemsSource = new string[] {"uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno"
				, "due"
			};
			l.BackgroundColor = Color.Yellow;
			*/

			rightPanel = new AbsoluteLayout () {
开发者ID:alessandrofacchini,项目名称:ImagoPCL,代码行数:67,代码来源:Map.cs


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