Hello,
I have implemented a custom AppointmentElement and I habe a small display problem with it.
Here is a screenshot:
When the area of the appointment gets to small, the arrow on the right is no longer drawn, but i want the element to always draw it and cut the text first.
Here is my implementation:
internal class CustomAppointmentElement : AppointmentElement
{
private AppointmentsViewModel _appointmentsViewModel;
private DockLayoutPanel _outerContainer;
private StackLayoutElement _container;
private LightVisualButtonElement _expandCollapseButton;
private LightVisualElement _icon1;
private LightVisualElement _icon2;
private LightVisualElement _icon3;
private LightVisualElement _timeText;
private LightVisualElement _summaryText;
private LightVisualElement _continueArrow;
protected override void CreateChildElements()
{
base.CreateChildElements();
this.Padding = new Padding(1, 0, 1, 0);
_outerContainer = new DockLayoutPanel();
_outerContainer.StretchHorizontally = true;
_outerContainer.StretchVertically = true;
_outerContainer.ShouldHandleMouseInput = false;
_outerContainer.NotifyParentOnMouseInput = true;
_outerContainer.LastChildFill = true;
_continueArrow = new LightVisualElement();
_continueArrow.Image = ArrowRightImage;
_continueArrow.StretchHorizontally = false;
_container = new StackLayoutElement();
_container.Orientation = Orientation.Horizontal;
_container.Alignment = ContentAlignment.MiddleLeft;
_container.StretchHorizontally = false;
_container.StretchVertically = true;
_container.ShouldHandleMouseInput = false;
_container.NotifyParentOnMouseInput = true;
_expandCollapseButton = new LightVisualButtonElement();
_expandCollapseButton.ShouldHandleMouseInput = true;
_expandCollapseButton.Margin = new Padding(1, 1, 0, 1);
_expandCollapseButton.NotifyParentOnMouseInput = false;
_expandCollapseButton.Alignment = ContentAlignment.MiddleLeft;
_expandCollapseButton.StretchHorizontally = false;
_expandCollapseButton.StretchVertically = false;
_expandCollapseButton.Click += _expandCollapseButton_Click;
_expandCollapseButton.Image = GetButtonImage(false);
_icon1 = new LightVisualElement();
_icon1.ShouldHandleMouseInput = false;
_icon1.Margin = new Padding(1, 1, 0, 1);
_icon1.NotifyParentOnMouseInput = true;
_icon1.Alignment = ContentAlignment.MiddleLeft;
_icon1.StretchHorizontally = false;
_icon1.StretchVertically = false;
_icon2 = new LightVisualElement();
_icon2.ShouldHandleMouseInput = false;
_icon2.NotifyParentOnMouseInput = true;
_icon2.Alignment = ContentAlignment.MiddleLeft;
_icon2.StretchHorizontally = false;
_icon2.StretchVertically = false;
_icon2.Margin = new Padding(2, 1, 0, 1);
_icon3 = new LightVisualElement();
_icon3.ShouldHandleMouseInput = false;
_icon3.NotifyParentOnMouseInput = true;
_icon3.Alignment = ContentAlignment.MiddleLeft;
_icon3.StretchHorizontally = false;
_icon3.StretchVertically = false;
_icon3.Margin = new Padding(2, 1, 0, 1);
_timeText = new LightVisualElement();
_timeText.Alignment = ContentAlignment.MiddleLeft;
_timeText.ShouldHandleMouseInput = false;
_timeText.NotifyParentOnMouseInput = true;
_timeText.StretchHorizontally = false;
_timeText.StretchVertically = false;
_timeText.Margin = new Padding(2, 1, 2, 1);
_timeText.ClipText = true;
_timeText.TextWrap = false;
_timeText.AutoEllipsis = true;
_summaryText = new LightVisualElement();
_summaryText.Alignment = ContentAlignment.MiddleLeft;
_summaryText.ShouldHandleMouseInput = false;
_summaryText.NotifyParentOnMouseInput = true;
_summaryText.StretchHorizontally = false;
_summaryText.StretchVertically = false;
_summaryText.Margin = new Padding(2, 1, 2, 1);
_summaryText.ClipText = true;
_summaryText.TextWrap = false;
_summaryText.AutoEllipsis = true;
_summaryText.Font = new Font(_summaryText.Font, FontStyle.Bold);
_container.Children.Add(_expandCollapseButton);
_container.Children.Add(_icon1);
_container.Children.Add(_icon2);
_container.Children.Add(_icon3);
_container.Children.Add(_timeText);
_container.Children.Add(_summaryText);
DockLayoutPanel.SetDock(_container, Telerik.WinControls.Layouts.Dock.Left);
_outerContainer.Children.Add(_continueArrow);
DockLayoutPanel.SetDock(_continueArrow, Telerik.WinControls.Layouts.Dock.Right);
_outerContainer.Children.Add(_container);
Children.Add(_outerContainer);
}
}
Hope you could help me solve it.
Regards,
Stephan