當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。