當前位置: 首頁>>代碼示例>>C#>>正文


C# AbsoluteLayout.LowerChild方法代碼示例

本文整理匯總了C#中AbsoluteLayout.LowerChild方法的典型用法代碼示例。如果您正苦於以下問題:C# AbsoluteLayout.LowerChild方法的具體用法?C# AbsoluteLayout.LowerChild怎麽用?C# AbsoluteLayout.LowerChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AbsoluteLayout的用法示例。


在下文中一共展示了AbsoluteLayout.LowerChild方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Bugzilla29229

	    public Bugzilla29229()
	    {
		    var absLayout = new AbsoluteLayout();
            absLayout.BackgroundColor = Color.Red;
            absLayout.Scale = 1;

            var cPx = new ListView ();
            //Point ptx = Point.Zero;
		    cPx.ItemTapped += delegate (object sender, ItemTappedEventArgs e) {
		    };
            cPx.ClassId = "weather";
            cPx.Layout (new Rectangle (0,0,480,768));
            absLayout.Children.Add (cPx, new Rectangle (cPx.X, cPx.Y, cPx.Width, cPx.Height), AbsoluteLayoutFlags.None);
            absLayout.LowerChild (cPx);
		    PushAsync (new ContentPage { Content = absLayout });
	    }
開發者ID:Costo,項目名稱:Xamarin.Forms,代碼行數:16,代碼來源:Bugzilla29229.cs

示例2: FetchForm

        public static void FetchForm(AbsoluteLayout Parent, System.Xml.Linq.XNode Nodes)
        {
            int cIndex = 0;
            int TabIndexes = ((System.Xml.Linq.XElement) Nodes).Elements().Count();
            foreach(XElement C in ((System.Xml.Linq.XElement) Nodes).Elements()) {
                if (C.Name == "Object") {
                    cIndex++;
                    if (true) {
                        if (C.Attribute("type").Value.StartsWith("System.Windows.Forms.PictureBox")) {
                            var CP = new Image();
                            foreach (XElement V in C.Elements()) {
                                if (V.Name == "Property") {
                                    switch (V.Attribute("name").Value) {
                                        case "Location":
                                            CP.ORect = new Rectangle(Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))), Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)), CP.ORect.Width, CP.ORect.Height);
                                            CP.Layout(new Rectangle(
                                                Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))) * App.ScaleFactorX,
                                                Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)) * App.ScaleFactorY,
                                                CP.Width,
                                                CP.Height));
                                            Point pt = new Point(Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))) * App.ScaleFactorX,
                                                Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)) * App.ScaleFactorY);
                                            break;
                                        case "Size":
                                            CP.ORect = new Rectangle(CP.ORect.Left, CP.ORect.Top, Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))), Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)));
                                            CP.Layout(new Rectangle(CP.X, CP.Y, Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))) * App.ScaleFactorX, Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)) * App.ScaleFactorY));
                                            break;
                                        case "SizeMode":
                                            if (V.Value == "StretchImage") {
                                                CP.Aspect = Aspect.Fill ;
                                            } else if (V.Value == "Zoom") {
                                                CP.Aspect = Aspect.AspectFill;
                                            } else if (V.Value == "Normal") {
                                                CP.Aspect = Aspect.AspectFit;
                                            }
                                            break;
                                        case "Image":
                                            string IMGData = String.Concat(V.Value);
                                            byte[] B = System.Convert.FromBase64String(IMGData);
                                            CP.Source = ImageSource.FromStream(() => new System.IO.MemoryStream(B));
                                            break;
                                        case "BackColor":
                                            CP.BackgroundColor = ColorExtensions.GetXColor(String.Concat(V.Nodes()));
                                            break;
                                        case "Tag":
                                            CP.ClassId = String.Concat(V.Nodes());
                                            break;
                                    }
                                }
                            }
                            CP.Aspect = Aspect.AspectFill;
                            Parent.Children.Add(CP, new Rectangle(CP.X, CP.Y, CP.Width, CP.Height), AbsoluteLayoutFlags.None);
                            Parent.LowerChild(CP);
                        } else if (C.Attribute("type").Value.StartsWith("System.Windows.Forms.Button")) {
                            var CP = new Button ();
                            foreach(XElement V in C.Elements()) {
                                if (V.Name == "Property") {
                                    switch (V.Attribute("name").Value) {
                                        case "Location":
                                            CP.ORect = new Rectangle(Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))), Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)), CP.ORect.Width, CP.ORect.Height);
                                            CP.Layout(new Rectangle(
                                                Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))) * App.ScaleFactorX,
                                                Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)) * App.ScaleFactorY,
                                                CP.Width,
                                                CP.Height));
                                            Point pt = new Point(Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))) * App.ScaleFactorX,
                                                Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)) * App.ScaleFactorY);
                                            break;
                                        case "Size":
                                            CP.ORect = new Rectangle(CP.ORect.Left, CP.ORect.Top, Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))), Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)));
                                            CP.Layout(new Rectangle(CP.X, CP.Y, Convert.ToInt32(String.Concat(V.Nodes()).Substring(0, String.Concat(V.Nodes()).IndexOf(","))) * App.ScaleFactorX, Convert.ToInt32(String.Concat(V.Nodes()).Substring(String.Concat(V.Nodes()).IndexOf(",") + 1)) * App.ScaleFactorY));
                                            break;
                                        case "Image":
                                            string IMGData = String.Concat(V.Value);
                                            byte[] B = System.Convert.FromBase64String(IMGData);
                                            var TempFile = System.IO.Path.GetTempFileName();
                                            System.IO.File.WriteAllBytes(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "/" + System.IO.Path.GetFileName(TempFile), B);
                                            CP.Image = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "/" + System.IO.Path.GetFileName(TempFile);
                                            break;
                                        case "ForeColor":
                                            CP.TextColor = ColorExtensions.GetXColor(String.Concat(V.Nodes()));
                                            break;
                                        case "BackColor":
                                            CP.BackgroundColor = ColorExtensions.GetXColor(String.Concat(V.Nodes()));
                                            break;
                                        case "Caption":
                                        case "Text":
                                            CP.Text = String.Concat(V.Nodes()).Replace("##", "\r\n");
                                            break;
                                        case "Tag":
                                            CP.ClassId = String.Concat(V.Nodes());
                                            break;
                                        case "Font":
                                            string[] UFont = String.Concat(V.Nodes()).Replace("style=", "").Replace("Microsoft Sans Serif", "Helvetica").Split(new[] {
                                                ","
                                            }, StringSplitOptions.RemoveEmptyEntries);
                                            CP.FontFamily = UFont[0];
                                            CP.FontSize = float.Parse(UFont[1].Replace("pt", ""));
                                            if (Array.IndexOf(UFont, " Bold") > -1) {
                                                CP.FontAttributes = CP.FontAttributes | FontAttributes.Bold;
//.........這裏部分代碼省略.........
開發者ID:MuffPotter,項目名稱:XamarinDesigner,代碼行數:101,代碼來源:Parser.cs


注:本文中的AbsoluteLayout.LowerChild方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。