Esempio n. 1
0
 public override void Load(XElement element)
 {
     if (element.Element("GridType") is XElement gridType)
     {
         this.GridType = XML.CreatePatternGridMode(gridType.Value);
     }
     if (element.Element("HorizontalStep") is XElement horizontalStep)
     {
         this.HorizontalStep = (float)horizontalStep;
     }
     if (element.Element("VerticalStep") is XElement verticalStep)
     {
         this.VerticalStep = (float)verticalStep;
     }
 }
 public override void Load(XElement element)
 {
     if (element.Element("GridType") is XElement gridType)
     {
         try
         {
             this.GridType = (PatternGridType)Enum.Parse(typeof(PatternGridType), gridType.Value);
         }
         catch (Exception) { }
     }
     if (element.Element("HorizontalStep") is XElement horizontalStep)
     {
         this.HorizontalStep = (float)horizontalStep;
     }
     if (element.Element("VerticalStep") is XElement verticalStep)
     {
         this.VerticalStep = (float)verticalStep;
     }
 }
 private Visibility VerticalStepVisibilityConverter(PatternGridType value) => value == PatternGridType.Horizontal ? Visibility.Collapsed : Visibility.Visible;