public static sw.FrameworkElementFactory ImageBlock() { var factory = new sw.FrameworkElementFactory(typeof(swc.Image)); factory.SetValue(sw.FrameworkElement.MaxHeightProperty, 16.0); factory.SetValue(sw.FrameworkElement.MaxWidthProperty, 16.0); factory.SetValue(swc.Image.StretchDirectionProperty, swc.StretchDirection.DownOnly); factory.SetValue(sw.FrameworkElement.MarginProperty, new sw.Thickness(0, 2, 2, 2)); factory.SetBinding(swc.Image.SourceProperty, new sw.Data.Binding { Converter = new ImageConverter() }); return factory; }
public static sw.FrameworkElementFactory ImageBlock() { var factory = new sw.FrameworkElementFactory(typeof(swc.Image)); factory.SetValue(sw.FrameworkElement.MaxHeightProperty, 16.0); factory.SetValue(sw.FrameworkElement.MaxWidthProperty, 16.0); factory.SetValue(swc.Image.StretchDirectionProperty, swc.StretchDirection.DownOnly); factory.SetValue(sw.FrameworkElement.MarginProperty, new sw.Thickness(0, 2, 2, 2)); factory.SetBinding(swc.Image.SourceProperty, new sw.Data.Binding { Converter = new ImageConverter() }); return(factory); }
public static sw.FrameworkElementFactory TextBlock(bool setMargin = true) { var factory = new sw.FrameworkElementFactory(typeof(swc.TextBlock)); factory.SetBinding(swc.TextBlock.TextProperty, new sw.Data.Binding { Path = TextPath }); if (setMargin) factory.SetValue(sw.FrameworkElement.MarginProperty, new sw.Thickness(2)); return factory; }
public static sw.FrameworkElementFactory ItemTemplate(bool editable, swd.RelativeSource relativeSource = null) { var factory = new sw.FrameworkElementFactory(typeof(swc.StackPanel)); factory.SetValue(swc.StackPanel.OrientationProperty, swc.Orientation.Horizontal); factory.AppendChild(ImageBlock()); factory.AppendChild(editable ? EditableBlock(relativeSource) : TextBlock()); return factory; }
public static sw.FrameworkElementFactory ItemTemplate(bool editable, swd.RelativeSource relativeSource = null) { var factory = new sw.FrameworkElementFactory(typeof(swc.StackPanel)); factory.SetValue(swc.StackPanel.OrientationProperty, swc.Orientation.Horizontal); factory.AppendChild(ImageBlock()); factory.AppendChild(editable ? EditableBlock(relativeSource) : TextBlock()); return(factory); }
public static sw.FrameworkElementFactory TextBlock(bool setMargin = true) { var factory = new sw.FrameworkElementFactory(typeof(swc.TextBlock)); factory.SetBinding(swc.TextBlock.TextProperty, new sw.Data.Binding { Path = TextPath }); if (setMargin) { factory.SetValue(sw.FrameworkElement.MarginProperty, new sw.Thickness(2)); } return(factory); }