]> O.S.I.I.S - jp/crow.git/commitdiff
SearchExtMethod in CrowAssemblies, textbox xtranslation following cursor
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 4 Jun 2020 16:14:36 +0000 (18:14 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 4 Jun 2020 16:14:36 +0000 (18:14 +0200)
16 files changed:
Crow/Templates/DirectoryView.template
Crow/src/Cairo/CairoHelpers.cs
Crow/src/ExtensionsMethods.cs
Crow/src/IML/CompilerServices.cs
Crow/src/IML/MemberAddress.cs
Crow/src/Mono.Cairo/Context.cs
Crow/src/Widgets/Border.cs
Crow/src/Widgets/ColorSlider.cs
Crow/src/Widgets/DirectoryView.cs
Crow/src/Widgets/FileDialog.cs
Crow/src/Widgets/HueSelector.cs
Crow/src/Widgets/Label.cs
Crow/src/Widgets/SaturationValueSelector.cs
Crow/src/Widgets/TextBox.cs
Samples/ShowCase/ShowCase.cs
Samples/ShowCase/ui/showcase.crow

index d2193338810f3639457e73fb7aba67a8a0ff2129..36f042cfc847cdc94b2fe700f703c6b0db7d8f76 100644 (file)
@@ -12,7 +12,7 @@
                        </HorizontalStack>
                </Border>
        </ItemTemplate>
-       <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
+       <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfosOrdered">
                <Expandable Caption="{Name}" MouseDoubleClick="/onClickForExpand">
                        <Template>
                                <VerticalStack>
index d5263df396ef1306e06a34a351a3fd057dd1def8..a2e036ac385e61ac9330db6b9f5f1c6c9d65f95b 100644 (file)
@@ -101,13 +101,13 @@ namespace Crow
             gr.Save();
             r.Inflate((int)-width / 2, (int)-width / 2);
             gr.LineWidth = width;
-                       gr.SetSourceColor(Colors.White);
+                       gr.SetSource(Colors.White);
             gr.MoveTo(r.BottomLeft);
             gr.LineTo(r.TopLeft);
             gr.LineTo(r.TopRight);
             gr.Stroke();
 
-                       gr.SetSourceColor(Colors.DarkGrey);
+                       gr.SetSource(Colors.DarkGrey);
             gr.MoveTo(r.TopRight);
             gr.LineTo(r.BottomRight);
             gr.LineTo(r.BottomLeft);
@@ -120,12 +120,12 @@ namespace Crow
             gr.Save();
             r.Inflate((int)-width / 2, (int)-width / 2);
             gr.LineWidth = width;
-                       gr.SetSourceColor(Colors.DarkGrey);
+                       gr.SetSource(Colors.DarkGrey);
             gr.MoveTo(r.BottomLeft);
             gr.LineTo(r.TopLeft);
             gr.LineTo(r.TopRight);
             gr.Stroke();
-                       gr.SetSourceColor(Colors.White);
+                       gr.SetSource(Colors.White);
             gr.MoveTo(r.TopRight);
             gr.LineTo(r.BottomRight);
             gr.LineTo(r.BottomLeft);
index 69edfe8e42aafb338df6298a963ef9ec5325f20a..0ac07c11df7532a4c01d0b7ba84db70276e8a56e 100644 (file)
@@ -3,6 +3,8 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+using System.IO;
+using System.Linq;
 using System.Linq.Expressions;
 
 namespace Crow
@@ -132,10 +134,6 @@ namespace Crow
                        ctx.Stroke ();
                }
 
-               public static void SetSourceColor(this Cairo.Context ctx, Color c)
-               {
-                       ctx.SetSourceRGBA(c.R,c.G,c.B,c.A);
-               }
                public static void AddColorStop(this Cairo.Gradient grad, double offset, Color c)
                {
                        grad.AddColorStop (offset, c);
@@ -192,6 +190,9 @@ namespace Crow
                        
                        return null;
                }
+
+               public static FileSystemInfo [] GetFileSystemInfosOrdered (this DirectoryInfo di)
+                       => di.GetFileSystemInfos ().OrderBy (f => f.Attributes).ThenBy (f => f.Name).ToArray ();
        }
 }
 
index cf3ee73f8f9312c235ff3aa040f71d31f340f451..ea25e9bbc372ee2a6104f83d75cb86ffc37ed688 100644 (file)
@@ -382,19 +382,27 @@ namespace Crow.IML
                        //System.Diagnostics.Debug.WriteLine ($"*** search extension method: {t};{methodName} => key={key}");
 
                        MethodInfo mi = null;
-                       mi = GetExtensionMethods (Assembly.GetEntryAssembly (), t, methodName);
-                       if (mi == null)
-                               mi = GetExtensionMethods (t.Module.Assembly, t, methodName);
+                       if (!TryGetExtensionMethods (Assembly.GetEntryAssembly (), t, methodName, out mi)) {
+                               if (!TryGetExtensionMethods (t.Module.Assembly, t, methodName, out mi)) {
+                                       foreach (Assembly a in Interface.crowAssemblies) {
+                                               if (TryGetExtensionMethods (a, t, methodName, out mi))
+                                                       break;
+                                       }
+                                       if (mi == null)
+                                               TryGetExtensionMethods (Assembly.GetExecutingAssembly (), t, methodName, out mi);//crow Assembly
+                               }
+                       }
 
                        //add key even if mi is null to prevent searching again and again for propertyless bindings
                        knownExtMethods.Add (key, mi);
                        return mi;
                }
 
-               public static MethodInfo GetExtensionMethods (Assembly assembly, Type extendedType, string methodName)
+               public static bool TryGetExtensionMethods (Assembly assembly, Type extendedType, string methodName, out MethodInfo foundMI)
                {
+                       foundMI = null;
                        if (assembly == null)
-                               return null;
+                               return false;
                        foreach (Type t in assembly.GetTypes ().Where
                                        (ty => ty.IsDefined (typeof (ExtensionAttribute), false))) {
                                foreach (MethodInfo mi in t.GetMethods 
@@ -403,14 +411,16 @@ namespace Crow.IML
                                                 m.GetParameters ().Length == 1)) {
                                        Type curType = extendedType;
                                        while (curType != null) {
-                                               if (mi.GetParameters () [0].ParameterType == curType)
-                                                       return mi;
+                                               if (mi.GetParameters () [0].ParameterType == curType) {
+                                                       foundMI = mi;
+                                                       return true;
+                                               }
                                                curType = curType.BaseType;
                                        }                                               
                                }
                        
                        }
-                       return null;
+                       return false;
                }
                /// <summary>
                /// retrieve event handler in class or ancestors
index 365a1994af0b100c694fe9dad7742d3619adacf0..6797e8ea6c7f9c1329447bc07b8deb0066184f33 100644 (file)
@@ -101,13 +101,8 @@ namespace Crow.IML
                        Type t = Address.LastOrDefault ().CrowType;
                        member = t.GetMember (memberName, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance).FirstOrDefault ();
 
-#region search for extensions methods if member not found in type
-                       if (member == null && !string.IsNullOrEmpty (memberName)) {
-                               Assembly a = Assembly.GetExecutingAssembly ();
-                               string mn = memberName;
-                               member = CompilerServices.GetExtensionMethods (a, t, mn);
-                       }
-#endregion
+                       if (member == null && !string.IsNullOrEmpty (memberName))
+                               member = CompilerServices.SearchExtMethod (t, memberName);
 
                        return member != null;
                }
index 9be56c02d2c4fb5ca783e4ba8b9f2f24e154e297..7ed5e62ca688c706ef80380455707ad4269b34a4 100644 (file)
@@ -324,7 +324,7 @@ namespace Crow.Cairo {
                        get { return NativeMethods.cairo_get_reference_count (handle); }
                }
 
-               public void SetSourceColor (Color color)
+               public void SetSource (Color color)
                {
                        NativeMethods.cairo_set_source_rgba (handle, color.R / 255.0, color.G / 255.0, color.B / 255.0, color.A / 255.0);
                }
index 51758cd0ba1751433f58eb0bc0c499285129ebc5..cc331e78e11656787cfe3c76012647bd54d0fe59 100644 (file)
@@ -137,7 +137,7 @@ namespace Crow
                                        double radius = CornerRadius;
                                        if ((radius > rBack.Height / 2.0) || (radius > rBack.Width / 2.0))
                                                radius = Math.Min (rBack.Height / 2.0, rBack.Width / 2.0);
-                                       gr.SetSourceColor (sunkenColor);
+                                       gr.SetSource (sunkenColor);
                                        gr.MoveTo (0.5 + rBack.Left, -0.5 + rBack.Bottom - radius);
                                        gr.ArcNegative (0.5 + rBack.Left + radius, -0.5 + rBack.Bottom - radius, radius, Math.PI, Math.PI * 0.75);
                                        gr.MoveTo (0.5 + rBack.Left, -0.5 + rBack.Bottom - radius);
@@ -156,7 +156,7 @@ namespace Crow
                                                gr.Arc (0.5 + rBack.Left + radius, -0.5 + rBack.Bottom - radius, radius - 1.0, Math.PI / 2.0, Math.PI * 0.75);
                                                gr.Stroke ();
 
-                                               gr.SetSourceColor (raisedColor);
+                                               gr.SetSource (raisedColor);
                                                gr.MoveTo (1.5 + rBack.Left, -1.5 + rBack.Bottom - radius);
                                                gr.ArcNegative (0.5 + rBack.Left + radius, -0.5 + rBack.Bottom - radius, radius - 1.0, Math.PI, Math.PI * 0.75);
                                                gr.MoveTo (1.5 + rBack.Left, -1.5 + rBack.Bottom - radius);
@@ -166,7 +166,7 @@ namespace Crow
                                                gr.Arc (-0.5 + rBack.Right - radius, 0.5 + rBack.Top + radius, radius - 1.0, Math.PI * 1.5, Math.PI * 1.75);
                                        } else {
                                                gr.Stroke ();
-                                               gr.SetSourceColor (raisedColor);
+                                               gr.SetSource (raisedColor);
                                        }
                                        gr.MoveTo (-0.5 + rBack.Right, 0.5 + rBack.Top + radius);
                                        gr.ArcNegative (-0.5 + rBack.Right - radius, 0.5 + rBack.Top + radius, radius, 0, -Math.PI * 0.25);
@@ -177,7 +177,7 @@ namespace Crow
                                        gr.Arc (0.5 + rBack.Left + radius, -0.5 + rBack.Bottom - radius, radius, Math.PI / 2.0, Math.PI * 0.75);
                                        gr.Stroke ();
                                } else {
-                                       gr.SetSourceColor (sunkenColor);
+                                       gr.SetSource (sunkenColor);
                                        gr.MoveTo (0.5 + rBack.Left, rBack.Bottom);
                                        gr.LineTo (0.5 + rBack.Left, 0.5 + rBack.Y);
                                        gr.LineTo (rBack.Right, 0.5 + rBack.Y);
@@ -186,13 +186,13 @@ namespace Crow
                                                gr.LineTo (-1.5 + rBack.Right, -1.5 + rBack.Bottom);
                                                gr.LineTo (2.0 + rBack.Left, -1.5 + rBack.Bottom);
                                                gr.Stroke ();
-                                               gr.SetSourceColor (raisedColor);
+                                               gr.SetSource (raisedColor);
                                                gr.MoveTo (1.5 + rBack.Left, -1.0 + rBack.Bottom);
                                                gr.LineTo (1.5 + rBack.Left, 1.5 + rBack.Y);
                                                gr.LineTo (rBack.Right, 1.5 + rBack.Y);
                                        } else {
                                                gr.Stroke ();
-                                               gr.SetSourceColor (raisedColor);
+                                               gr.SetSource (raisedColor);
                                        }
                                        gr.MoveTo (-0.5 + rBack.Right, 1.5 + rBack.Y);
                                        gr.LineTo (-0.5 + rBack.Right, -0.5 + rBack.Bottom);
@@ -220,16 +220,16 @@ namespace Crow
                                        Foreground.SetAsSource (gr, rBack);
                                else {
                                        if (BorderStyle == BorderStyle.Sunken)
-                                               gr.SetSourceColor (raisedColor);
+                                               gr.SetSource (raisedColor);
                                        else
-                                               gr.SetSourceColor (sunkenColor);
+                                               gr.SetSource (sunkenColor);
 
                                        CairoHelpers.CairoRectangle (gr, rBack, crad, bw);
 
                                        if (BorderStyle == BorderStyle.Sunken)
-                                               gr.SetSourceColor (sunkenColor);
+                                               gr.SetSource (sunkenColor);
                                        else
-                                               gr.SetSourceColor (raisedColor);
+                                               gr.SetSource (raisedColor);
 
                                        bw /= 2.0;
                                        rBack.Width -= (int)Math.Round(bw);
index fe2b78dc29ffdcd2970e960d2aa88d00ffe4722b..1e4029dcda8f8db8e03d6791031ab1ae76d7f7db 100644 (file)
@@ -221,10 +221,10 @@ namespace Crow
                                break;
                        }
 
-                       gr.SetSourceColor (Colors.Black);
+                       gr.SetSource (Colors.Black);
                        gr.LineWidth = 2.0;
                        gr.StrokePreserve ();
-                       gr.SetSourceColor (Colors.White);
+                       gr.SetSource (Colors.White);
                        gr.LineWidth = 1.0;
                        gr.Stroke ();
                }
index c664f517f0b8721a6e32a037c587ecfe93541d99..8768d65f029db7970b3950fd496aab181be1e340 100644 (file)
@@ -94,8 +94,8 @@ namespace Crow
                                        if (showFiles && !string.IsNullOrEmpty(fileMask))
                                                fi.AddRange(di.GetFiles(fileMask));
                                        return showHidden ?
-                                               fi.ToArray() :
-                                               fi.Where(f=>!f.Attributes.HasFlag (FileAttributes.Hidden)).ToArray();
+                                               fi.OrderBy(f=>f.Attributes).ThenBy(f=>f.Name).ToArray() :
+                                               fi.Where(f=>!f.Attributes.HasFlag (FileAttributes.Hidden)).OrderBy (f => f.Attributes).ThenBy (f => f.Name).ToArray();
                                } catch (Exception ex) {
                                        System.Diagnostics.Debug.WriteLine (ex.ToString ());
                                        return null;
index db66ae9effa6471c0b46e09a0bd33bcd172b8e58..4a095e1faf57df2a33a32bc2cc3a25122757c42d 100644 (file)
@@ -1,37 +1,10 @@
-//
-// FileDialog.cs
+// Copyright (c) 2013-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
 //
-// Author:
-//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
-using System.Xml.Serialization;
 using System.ComponentModel;
 using System.IO;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text.RegularExpressions;
 
 namespace Crow
 {
index 50b52ae724b4381efb81afe1f0b703d9fbae732f..3e761b300121e6518b2fa538e0109d265456c606 100644 (file)
@@ -131,10 +131,10 @@ namespace Crow
                                break;                  
                        }
 
-                       gr.SetSourceColor (Colors.Black);
+                       gr.SetSource (Colors.Black);
                        gr.LineWidth = 2.0;
                        gr.StrokePreserve ();
-                       gr.SetSourceColor (Colors.White);
+                       gr.SetSource (Colors.White);
                        gr.LineWidth = 1.0;
                        gr.Stroke ();
                }
index 34a2d69ee7cd65544fca5c28abf8bd9f1128e295..e500b98f0944b78f74335926055a9bee80185f63 100644 (file)
@@ -173,8 +173,44 @@ namespace Crow {
                                else
                                        _currentCol = value;
                                NotifyValueChanged ("CurrentColumn", _currentCol);
+
+                               Rectangle cb = ClientRectangle;
+
+                               if (Width == Measure.Fit || cb.Width >= cachedTextSize.Width) {
+                                       xTranslation = 0;
+                                       return;
+                               }
+                               int xpos = xposition;
+                               if (xTranslation + xpos > cb.Width)
+                                       xTranslation = cb.Width - xpos;
+                               else if (xpos < -xTranslation)
+                                       xTranslation = -xpos;
+                               RegisterForRedraw ();
                        }
                }
+               int xTranslation = 0;
+               int xposition {
+                       get {
+                               using (Context gr = new Context (IFace.surf)) {
+                                       //Cairo.FontFace cf = gr.GetContextFontFace ();
+                                       gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+                                       gr.SetFontSize (Font.Size);
+                                       gr.FontOptions = Interface.FontRenderingOptions;
+                                       gr.Antialias = Interface.Antialias;
+                                       try {
+                                               string l = lines [_currentLine];
+                                               if (_currentCol < l.Length)
+                                                       l = l.Remove (Math.Min (_currentCol, l.Length));
+                                               l = l.Replace ("\t", new String (' ', Interface.TAB_SIZE));
+                                               return (int)Math.Ceiling (gr.TextExtents (l).XAdvance);
+                                       } catch {
+                                               System.Diagnostics.Debug.WriteLine ("xpos measuring fault in label");
+                                               return 0;
+                                       }
+                               }
+                       }
+               }
+
                [DefaultValue(0)]
                public int CurrentLine{
                        get { return _currentLine; }
@@ -258,7 +294,6 @@ namespace Crow {
                [XmlIgnore]public string SelectedText
                {
                        get {
-
                                if (SelRelease < 0 || SelBegin < 0)
                                        return "";
                                if (selectionStart.Y == selectionEnd.Y)
@@ -453,6 +488,9 @@ namespace Crow {
                        gr.FontOptions = Interface.FontRenderingOptions;
                        gr.Antialias = Interface.Antialias;
 
+                       gr.Save ();
+                       gr.Translate (xTranslation, 0);
+
                        rText = new Rectangle(new Size(
                                measureRawSize(LayoutingType.Width), measureRawSize(LayoutingType.Height)));
                        rText.Width -= 2 * Margin;
@@ -609,7 +647,7 @@ namespace Crow {
 
                                if (Selectable) {
                                        if (SelRelease >= 0 && i >= selectionStart.Y && i <= selectionEnd.Y) {
-                                               gr.SetSourceColor (selBackground);
+                                               gr.SetSource (selBackground);
 
                                                Rectangle selRect = lineRect;
 
@@ -632,7 +670,7 @@ namespace Crow {
                                                gr.FillPreserve ();
                                                gr.Save ();
                                                gr.Clip ();
-                                               gr.SetSourceColor (SelectionForeground);
+                                               gr.SetSource (SelectionForeground);
                                                gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + (fe.Ascent+fe.Descent) * i);
                                                gr.ShowText (l);
                                                gr.Fill ();
@@ -640,12 +678,15 @@ namespace Crow {
                                        }
                                }
                        }
+
+                       gr.Restore ();
                }
                #endregion
 
                #region Mouse handling
                void updatemouseLocalPos(Point mpos){
                        mouseLocalPos = mpos - ScreenCoordinates(Slot).TopLeft - ClientRectangle.TopLeft;
+                       mouseLocalPos.X -= xTranslation;
                        if (mouseLocalPos.X < 0)
                                mouseLocalPos.X = 0;
                        if (mouseLocalPos.Y < 0)
index 09c194cd50415d9186375bc18454b8197a6a0338..9732878b695ce8cf7aaa8bcc87ffc4b776bd5849 100644 (file)
@@ -69,10 +69,10 @@ namespace Crow
 
 
                        gr.Arc (mousePos.X, mousePos.Y, 3.5, 0, Math.PI * 2.0);
-                       gr.SetSourceColor (Colors.Black);
+                       gr.SetSource (Colors.Black);
                        gr.LineWidth = 2.0;
                        gr.StrokePreserve ();
-                       gr.SetSourceColor (Colors.White);
+                       gr.SetSource (Colors.White);
                        gr.LineWidth = 1.0;
                        gr.Stroke ();
                }
index 3f166d42433f28a170b4b153a0a7b88bdeae7581..60b43f45f56b13bf2545568f641555676d9b40ae 100644 (file)
@@ -12,11 +12,6 @@ namespace Crow
                #region CTOR
                protected TextBox() {}
                public TextBox(Interface iface, string style = null) : base (iface, style) { }
-//             public TextBox(string _initialValue)
-//                     : base(_initialValue)
-//             {
-//
-//             }
                #endregion
 
                #region GraphicObject overrides
@@ -32,15 +27,12 @@ namespace Crow
                protected override void onDraw (Context gr)
                {
                        base.onDraw (gr);
-                       FontExtents fe = gr.FontExtents;
                }
                #endregion
                        
         #region Keyboard handling
                public override void onKeyDown (object sender, KeyEventArgs e)
                {
-                       base.onKeyDown (sender, e);
-
                        Key key = e.Key;
 
                        switch (key)
@@ -170,8 +162,9 @@ namespace Crow
                        default:
                                break;
                        }
-
-                       RegisterForGraphicUpdate();
+                       e.Handled = true;
+                       base.onKeyDown (sender, e);
+                       RegisterForGraphicUpdate ();
                }
                public override void onKeyPress (object sender, KeyPressEventArgs e)
                {
index 8f3c70ec6cf4000310ba447658679332ffac187b..daab96e2699b30068c585e0841612a16d97ec3a0 100644 (file)
@@ -32,6 +32,13 @@ namespace ShowCase
                                NotifyValueChanged ("CurrentDir",CurrentDir);
                        }
                }
+               public void goUpDirClick (object sender, MouseButtonEventArgs e)
+               {
+                       string root = Directory.GetDirectoryRoot (CurrentDir);
+                       if (CurrentDir == root)
+                               return;
+                       CurrentDir = Directory.GetParent (CurrentDir).FullName;
+               }
 
                protected override void OnInitialized ()
                {
index 319021bf81db9d5115a959e923eb3436fd2eb83c..ae8912fe8aecf73beabbe10f113a5a6933676ac6 100644 (file)
@@ -1,6 +1,12 @@
 <?xml version="1.0"?>
 <HorizontalStack Background="DarkGrey" Margin="2">
-       <DirectoryView Name="dv" CurrentDirectory="Interfaces" Width="25%" SelectedItemChanged="Dv_SelectedItemChanged"/>
+       <VerticalStack  Width="25%">
+               <HorizontalStack Height="Fit">
+                       <Image Margin="2" Width="14" Height="14" Path="#Crow.Icons.level-up.svg" MouseClick="./goUpDirClick"/>                  
+                       <TextBox Text="{²CurrentDir}" Margin="2"/>
+               </HorizontalStack>              
+               <DirectoryView Name="dv" CurrentDirectory="{CurrentDir}" SelectedItemChanged="Dv_SelectedItemChanged"/>
+       </VerticalStack>
        <Splitter Width="6"/>
        <VerticalStack>
                <Container Name="CrowContainer" Height="60%" Background="Black"/>