Example #1
0
		public ParenthesesArea ()
		{
			Child = new ContentControl ()
			{
				Content = new TextArea (),
				VerticalAlignment = VerticalAlignment.Center
			};

			var stackPanel = new StackPanel ()
			{
				Orientation = Orientation.Horizontal
			};

			stackPanel.Children.Add (new OpenParentheses ());
			stackPanel.Children.Add (Child);

			var closeParentheses = new CloseParentheses ();
			BindingOperations.SetBinding (this, "DataContext.ShowCloseParentheses", closeParentheses.GetProperty ("Visibility"), new BooleanToVisibilityConverter ());

			stackPanel.Children.Add (closeParentheses);

			Content = stackPanel;

			BindingOperations.SetBinding (this, "DataContext.Child", Child.GetProperty ("Content"), new TokenAreaConverter ());		
		}
		public ItemsControl ()
		{
			itemsPanel = BuildProperty<Panel> ("ItemsPanel");
			itemsPanel.DependencyPropertyValueChanged += HandleItemsPanelChanged;
			
			ItemsPanel = new StackPanel ();
			itemsSource = BuildProperty<IEnumerable> ("ItemsSource");

			itemsSource.DependencyPropertyValueChanged += ItemsSourceChanged;

			ItemTemplate = new DataTemplate (o => o is UIElement ? o as UIElement : new TextBlock () {Text = o.ToString ()});
			
			StyleHelper.ApplyStyle (this, typeof(ItemsControl));
		}
Example #3
0
		public ResultArea ()
		{
			var line1 = new Line ()
			{
				WidthRequest = 12,
				HeightRequest = 2,
				StrokeThickness = 2,
				Stroke = Colors.Black,
				SnapsToDevicePixels = true
			};

			var line2 = new Line ()
			{
				WidthRequest = 12,
				HeightRequest = 2,
				StrokeThickness = 2,
				Stroke = Colors.Black,
				SnapsToDevicePixels = true
			};

			var canvas = new Canvas ();
			canvas.HeightRequest = 12;
			canvas.WidthRequest = 12;

			canvas.Children.Add (line1);
			canvas.Children.Add (line2);

			canvas.SetTop (3, line1);
			canvas.SetTop (7, line2);

			Child = new ContentControl ()
			{
				Content = new TextArea (),
				Margin = new Thickness (2, 0, 0, 0)
			};

			var stackPanel = new StackPanel ()
			{
				Orientation = Orientation.Horizontal
			};

			stackPanel.Children.Add (canvas);
			stackPanel.Children.Add (Child);

			Content = stackPanel;

			BindingOperations.SetBinding (this, "DataContext.Child", Child.GetProperty ("Content"), new TokenAreaConverter ());

			Margin = new Thickness (2, 0, 0, 0);
		}
Example #4
0
		public AbsoluteArea ()
		{
			Child = new ContentControl ()
			{
				Content = new TextArea (),
				VerticalAlignment = VerticalAlignment.Center,
				Margin = new Thickness(3)
			};

			var stackPanel = new StackPanel ()
			{
				Orientation = Orientation.Horizontal
			};

			stackPanel.Children.Add (new Line () { WidthRequest = 2, VerticalAlignment = VerticalAlignment.Stretch, StrokeThickness = 2, });
			stackPanel.Children.Add (Child);
			stackPanel.Children.Add (new Line () { WidthRequest = 2, VerticalAlignment = VerticalAlignment.Stretch, StrokeThickness = 2, });

			Content = stackPanel;

			BindingOperations.SetBinding (this, "DataContext.Child", Child.GetProperty ("Content"), new TokenAreaConverter ());	
		}