Exemplo n.º 1
0
		public static sw.FrameworkElementFactory EditableBlock(swd.RelativeSource relativeSource)
		{
			var factory = new sw.FrameworkElementFactory(typeof(EditableTextBlock));
			var binding = new sw.Data.Binding { Path = TextPath, RelativeSource = relativeSource, Mode = swd.BindingMode.TwoWay, UpdateSourceTrigger = swd.UpdateSourceTrigger.PropertyChanged };
			factory.SetBinding(EditableTextBlock.TextProperty, binding);
			return factory;
		}
Exemplo n.º 2
0
		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;
		}
Exemplo n.º 3
0
		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;
		}
Exemplo n.º 4
0
        public static sw.FrameworkElementFactory EditableBlock(swd.RelativeSource relativeSource)
        {
            var factory = new sw.FrameworkElementFactory(typeof(EditableTextBlock));
            var binding = new sw.Data.Binding {
                Path = TextPath, RelativeSource = relativeSource, Mode = swd.BindingMode.TwoWay, UpdateSourceTrigger = swd.UpdateSourceTrigger.PropertyChanged
            };

            factory.SetBinding(EditableTextBlock.TextProperty, binding);
            return(factory);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }