Quantcast
Channel: Inframon Blog
Viewing all articles
Browse latest Browse all 77

Editing an Authored Form

$
0
0

When editing a form in the Service Manager Authoring Tool it is best practice to use the Undo function rather than move a function or label that is in the wrong place, or no longer needed.  This is because every single property change (size, position, binding, etc) is recorded in sequence in the form.  When that form is rendered in the console all the changes are played through in sequence, which is why sometimes it seems like it takes longer to open console forms.

However, using the undo function can be cumbersome, particularly in forms that have been heavily customised and you can end up having to rebuild a lot of properties simply because you want to change one.  Luckily the underlying XML isn’t that difficult to follow so you can “snip” out unnecessary changes directly in the MP.

In the example below I have a basic form for recording info about Citrix desktop pools:

I need to move the description text box because I’ve put it in the wrong place.  So I need to find the correct text box in the MP XML.  This isn’t an exact science.  I typically find text boxes by searching for the binding.  Labels are easier because the friendly name will be listed.  In this case the textbox is bound to the Notes property, so that is what I search for to find this:

<PropertyBindingChange Object=”TextBox_2″ Property=”Text”>
<NewBinding Enabled=”True” Path=”Notes” Mode=”Default” BindsDirectlyToSource=”False” UpdateSourceTrigger=”Default” />
</PropertyBindingChange>

Now I’ve found the binding I can look at the object with which it is related to find the unique identifier.  In this case “TextBox_2”.   The easiest way to move it without have to redo all the properties that were built after it is to delete it altogether.  So I find all the properties that are “TextBox_2″ and delete them.  This is what the code looks like in my MP:

<AddControl Parent=”Grid_1″ Assembly=”PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ Type=”System.Windows.Controls.TextBox” Left=”213.5″ Top=”130″ Right=”306″ Bottom=”645″ Row=”0″ Column=”0″ />
<PropertyChange Object=”TextBox_2″ Property=”HorizontalAlignment”>
<NewValue>Left</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”Margin”>
<NewValue>213.5,130,0,645</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”VerticalAlignment”>
<NewValue>Top</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”Margin”>
<NewValue>213.5,130,0,0</NewValue>
</PropertyChange>
<Move X=”187″ Y=”34.52″>
<Element Name=”TextBox_2″ />
</Move>
<PropertyChange Object=”TextBox_2″ Property=”Margin”>
<NewValue>26.5,95.48,493,680</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”Margin”>
<NewValue>26.5,95.48,0,680</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”Margin”>
<NewValue>26.5,95.48,0,0</NewValue>
</PropertyChange>
<Resize Type=”BottomRight” X=”-470″ Y=”-148″>
<Element Name=”TextBox_2″ />
</Resize>
<PropertyChange Object=”TextBox_2″ Property=”Margin”>
<NewValue>26.5,95.48,23,532</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”HorizontalAlignment”>
<NewValue>Stretch</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”Width”>
<NewValue>Auto</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”Margin”>
<NewValue>26.5,95.48,23,0</NewValue>
</PropertyChange>
<PropertyChange Object=”TextBox_2″ Property=”Text”>
<NewValue></NewValue>
</PropertyChange>
<PropertyBindingChange Object=”TextBox_2″ Property=”Text”>
<NewBinding Enabled=”True” Path=”Notes” Mode=”Default” BindsDirectlyToSource=”False” UpdateSourceTrigger=”Default” />
</PropertyBindingChange>

Once I’ve deleted all these property changes my form looks like this:

Now I can add my description back in at the end of the form where I want it!  This streamlines the MP, as well as the form loading time in the console, and saves me a lot of time in form editing.


Viewing all articles
Browse latest Browse all 77

Trending Articles